-
Notifications
You must be signed in to change notification settings - Fork 489
Description
Before implementing socket.io-redis I used the following to get the socket object:
var socket = io.sockets.connected[socketId];
Now that I've implemented socket.io-redis I guess the command to replace it is:
var socket = io.of('/).connected[socketId];
However, it returns undefined in many, many cases where the socket actually exists.
I need to know how to get a socket's object by its id but without using any callback function since in my initial implementation I used as a return value as showed above and it is being currently used in many parts of the app.
UPDATE Jun 20th
I've also unsucessfully tried with io.of('/').adapter.nsp.connected[socket_id];
. It replies with the right socket object for just some cores, not for all of them, returning undefined most of the time.