playframework/play1 — pull request #709 by deanhiller (2013-12-13 16:15:14+00:00)
Title: [#1766] fix for websocket being overloaded

This prevents the websocket packet loss from the code doing a packet.poll()....not sure why someone decided to drop packets in the middle of a stream. the dropped packets resulted in our client missing many messages.

Ideally, the client should be slowed down through tcp flow control(usually done by simply letting the local nic buffer fill up and not reading from the socket when overloaded which then prevents one client from overloading the system as the remote nic buffer then fills up preventing him from writing to the socket).

This fix causes tcp flow control to kick in at a cost of tying up a nio thread :( but there is no nio token to tell the nio library to stop reading from the socket until the queue empties out a little.