Simple scenario:
socket = io.connect(...)
)
You might want to handle the reconnection yourself.
// Disables the automatic reconnection
var socket = io.connect('http://server.com', {
reconnection: false
});
// Reconnects on disconnection
socket.on('disconnect', function(){
socket.connect(callback);
});
Note: old versions used reconnect
instead of reconnection
.