I'm trying to migrate from Socket.IO 0.9 to 1.2.1, and I'm having some difficulty with socket reconnection. In 0.9, I could do something like socket.socket.reconnect();
, but unfortunately, socket.socket
doesn't exist and socket.io.reconnect
doesn't seem to reconnect my socket. However, socket.connect()
seems to reconnect using my original connect settings, but this doesn't seem right... why can't I use reconnect? I've looked at this thread, but forceNew
didn't seem to help. Just for completion's sake, my connect code looks like this:
var socket = io.connect('/myNamespace', {forceNew: true, path: '/path/to/socket.io'});
I ended up using
socket.connect()
... if anyone has a solution with.reconnect()
, I'm all ears.