liris/websocket-client — pull request #45 by mjhanninen (2013-08-20 20:03:09+00:00)
Title: Proposal for fixing issue #37

Here is my proposal for fixing the issue #37.

The patch adds buffering to two places: where bytes are bulk read from the underlying socket and where the incoming WebSocket frame is assembled. Buffers are used to retry a failed receive until the incoming frame is completed. Assuming that `socket` or `ssl` libraries won't miss the current and subsequent packets when a receive times out (which is reasonable assumption) the `websocket` library should not miss any frames nor fall into bad state due to timing out after this fix.

The patch contains some tests covering the changes. However I have **not** tested the patch extensively.