Closed EternityForest closed 7 years ago
This fails test_no_bytes_read, but that can be fixed by changing the code in websocket.py once(): to
x = self.sock.recv(4096)
if not x:
return False
self.buf = self.buf + x
To make sure that reading from an empty socket always returns false, but it adds complexity.
This PR solve quite many issues about stability of ws4py in case of interrupt. I'm going to rebase it and fix tests.
I rewrote once() to fix unit tests, and ensure all the data is read and processed (which was not the case in your pr if the data didn't meet the number of reading_buffer_size.)
I added a try block around the select calls that were giving errors on resume from suspend or on dropping root, and I fixed the bug that made it not send the last message until you send another one(Issues #172 and #167, the one that only happens on SSL)
I'm not too familiar with how the parser works so this might be the wrong solution.
Hope this helps!