0

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'});
Community
  • 1
  • 1
incutonez
  • 3,241
  • 9
  • 43
  • 92

2 Answers2

0

I ended up using socket.connect()... if anyone has a solution with .reconnect(), I'm all ears.

incutonez
  • 3,241
  • 9
  • 43
  • 92
0

A possible workaround to this issue is to execute:

 socket.io.skipReconnect = false;
 socket.io.reconnect();