You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have socket.io running on multiple servers and uses redis as the adapter. I am trying to access all the sockets in one room and see if the room is empty, but I couldn't find all the sockets connected to different servers, though they are in the same room.
var io
io = socket_io(server);
io.adapter(redis({ host: 'localhost', port: 6379 }));
io.nsps['/'].adapter.rooms[roomName] #returns undefined
# this doesn't work either, always complain 'clients' is undefined, thus can't be used as a function
io.of('/').in(roomName).clients(function(error, clients){
if (error) throw error;
console.log(clients);
});
The text was updated successfully, but these errors were encountered:
I have socket.io running on multiple servers and uses redis as the adapter. I am trying to access all the sockets in one room and see if the room is empty, but I couldn't find all the sockets connected to different servers, though they are in the same room.
The text was updated successfully, but these errors were encountered: