Commit 5a122db5 authored by Facundo Batista's avatar Facundo Batista

Added a select.select call in the test server loop to make sure the

socket is ready to be read from before attempting a read (this
prevents an error 10035 on some Windows platforms). [GSoC - Alan
McIntyre]
parent 7b15201a
...@@ -65,11 +65,13 @@ def capture_server(evt, buf): ...@@ -65,11 +65,13 @@ def capture_server(evt, buf):
else: else:
n = 200 n = 200
while n > 0: while n > 0:
data = conn.recv(10) r, w, e = select.select([conn], [], [])
# keep everything except for the newline terminator if r:
buf.write(data.replace('\n', '')) data = conn.recv(10)
if '\n' in data: # keep everything except for the newline terminator
break buf.write(data.replace('\n', ''))
if '\n' in data:
break
n -= 1 n -= 1
time.sleep(0.01) time.sleep(0.01)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment