Ignore if socket is blocking
This commit is contained in:
parent
000a00fec8
commit
0df5286c0e
@ -55,8 +55,11 @@ class Connection:
|
|||||||
if select.select([self._socket], [], []) != ([], [], []):
|
if select.select([self._socket], [], []) != ([], [], []):
|
||||||
# wait for data availiable
|
# wait for data availiable
|
||||||
while True:
|
while True:
|
||||||
|
try:
|
||||||
# fill buffer with one message
|
# fill buffer with one message
|
||||||
data = self._socket.recv(1024)
|
data = self._socket.recv(1024)
|
||||||
|
except BlockingIOError:
|
||||||
|
continue
|
||||||
|
|
||||||
if not data:
|
if not data:
|
||||||
# buffer is empty
|
# buffer is empty
|
||||||
|
Loading…
Reference in New Issue
Block a user