fix reconnection for socket.io 1.x

v1.18.x
barisusakli 10 years ago
parent 8ed06eb773
commit 1424acc88e

@ -48,13 +48,12 @@ app.uid = null;
socket.on('event:disconnect', function() { socket.on('event:disconnect', function() {
$(window).trigger('action:disconnected'); $(window).trigger('action:disconnected');
app.isConnected = false; app.isConnected = false;
socket.socket.connect(); socket.connect();
}); });
socket.on('reconnecting', function (data, attempt) { socket.on('reconnecting', function (attempt) {
if(attempt === parseInt(config.maxReconnectionAttempts, 10)) { if(attempt === parseInt(config.maxReconnectionAttempts, 10)) {
socket.socket.reconnectionAttempts = 0; socket.io.attempts = 0;
socket.socket.reconnectionDelay = config.reconnectionDelay;
return; return;
} }

Loading…
Cancel
Save