I am just trying to get connected sockets for a user list without other rooms, because i only have one room, which i want to get all connected users in the list. I am using NodeJS and socket.io.
This is not working:
var clients = io.sockets.connect();
var clients = io.sockets.clients();
gives all the connected sockets. For socket.io 1.0+ see this answer.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.