Skip to content

Commit 633c460

Browse files
committed
Implement retry on interrupt in read(), in case we receive EINTR. Ref Lawouach#176
1 parent 7668d39 commit 633c460

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

ws4py/websocket.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,11 @@ def once(self):
395395
return False
396396
self.buf += b
397397
except (socket.error, OSError, pyOpenSSLError) as e:
398-
self.unhandled_error(e)
399-
return False
398+
if hasattr(e, "errno") and e.errno == errno.EINTR:
399+
pass
400+
else:
401+
self.unhandled_error(e)
402+
return False
400403
else:
401404
# process as much as we can
402405
# the process will stop either if there is no buffer left

0 commit comments

Comments
 (0)