Sunday, 15 August 2010

javascript - Socket.io-client fires duplicate 'reconnect_failed' event -



javascript - Socket.io-client fires duplicate 'reconnect_failed' event -

it seems reconnect_failed event fired twice in socket.io-client. have tried setting different values reconnectionattempts, if 1, 2 or 3 fire event twice.

to reproduce scenario, run @ client side

var opts = { reconnection: true, reconnectionattempts: 3, reconnectiondelay: 500} var socket = io.connect(opts) socket.on('reconnect_failed', function() { console.log("reconnect failed") })

while running kill node server (ctrl+c) , next output in developer tools console:

reconnect failed reconnect failed

im using socket.io 1.0.5

this fixed in next version.

see reply on github: https://github.com/automattic/socket.io-client/issues/705

javascript sockets socket.io socket.io-1.0

No comments:

Post a Comment