Is this possible? I can't find any documentation on the subject but from the tests I've done so far, a new client id is assigned every time a client reconnects. If its not possible what would be the best workaround? Thanks!
In the first case, the Socket will automatically try to reconnect, after a given delay.
You can check the socket. connected property: var socket = io. connect(); console.
socket-io. client is the code for the client-side implementation of socket.io. That code may be used either by a browser client or by a server process that is initiating a socket.io connection to some other server (thus playing the client-side role in a socket.io connection).
At the moment I don't think it's possible (I've asked the same question myself to `3rd-Eden, Socket.IO core dev).
However you can setup some unique key yourself on the client's session, that's the best workaround at the moment and usually people find this ok (for example put the username on the session or another unique id).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With