I am trying to access a socket by its id. I have seen this and this stackoverflow posts. However,
io.sockets.connected[socket.id]
returns undefined.
This also doesn't work :
io.to(socket.id).emit("myMessage");
Socket is connected to a namespace (socket.id returns /playNS#1HhBtUM-6O_YsRwmAAAF) and socket.io version is 1.4.5. What am I doing wrong?