Lawouach / WebSocket-for-Python

WebSocket client and server library for Python 2 and 3 as well as PyPy (ws4py 0.5.1)
https://ws4py.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
1.12k stars 288 forks source link

Block on receiving from SSL socket #212

Closed awelkie closed 7 years ago

awelkie commented 7 years ago

This fixes a bug where not receiving any bytes immediately from an SSL socket would be considered a socket error and the connection would be closed. This changes the code to block and wait for bytes from the SSL socket.

To test, I used the example DummyClient script in the tutorial and pointed it to "wss://echo.websocket.org". Without this change, the example script closes the connection without receiving any messages. With the change, the expected behavior occurs.

tito commented 7 years ago

No tests broken, thanks you! It would have been nice to have a test about it, maybe you can?

awelkie commented 7 years ago

Sure, no problem. See PR #213