I did some search here and found this answer
// list all connected sockets
var list = io.sockets.sockets;
console.log("Connected sockets:");
list.forEach(function(s) {
console.log(" socket.id = ", s.id);
});
But because io.sockets.sockets;
that mentioned there is NOT an array it doesn't work.so i have 2 questions :
a)How can i access to all sockets connected?
b)How can i access to sockets connected to specific room?
Cheers
PS:this question is asked before but those questions are out dated.