Reconnection fixes

125 views
Skip to first unread message

mark

unread,
Jul 17, 2013, 2:58:05 PM7/17/13
to sock...@googlegroups.com
Hi,

I made some fixes for reconnection issues that others may find helpful. Hopefully Guillermo will throw this into 0.9.17, but in any case you can just use socket.io.js (or minified) from here:

Summary of fixes:
This commit fixes two issues with reconnections:
  1. The reconnection delay is meaningless if the handshake is not replied. Previously, it was often the case that the socket would go into "reconnecting", but no further reconnection attempts would be made since frequently the handshake XHR would not return (most often observed with websocket connections when the server restarts). This fix provides a handshake timeout that is a bit shorter than the reconnection delay, so further reconnection attempts can actually take place. Note that this fix only affects browsers with XMLHttpRequest - i.e. Chrome, FF, IE10+, etc.
  2. socket.disconnect() on the client side was not respected if called while the socket was in the reconnecting state. Fixed.


mark

unread,
Jul 17, 2013, 4:55:16 PM7/17/13
to sock...@googlegroups.com
And also:
3. reconnect_failed event will be fired after max reconnection attempts failed, see LearnBoost/socket.io#652
4. Fix to actually make it max reconnection attempts (it was originally off by 1)
Reply all
Reply to author
Forward
0 new messages