How to get room’s clients list in socket.io 1.0

Consider this rather more complete answer linked in a comment above on the question: https://stackoverflow.com/a/24425207/1449799 The clients in a room can be found at io.nsps[yourNamespace].adapter.rooms[roomName] This is an associative array with keys that are socket ids. In our case, we wanted to know the number of clients in a room, so we did Object.keys(io.nsps[yourNamespace].adapter.rooms[roomName]).length In … Read more

Ajax vs Socket.io

Many of the generic tradeoffs between webSocket and Ajax are discussed here: websocket vs rest API for real time data? Some tradeoff issues for mobile devices are discussed here: Cordova: Sockets, PushNotifications, or repeatedly polling server? In a nutshell, if your data is primarily server-driven and then needs to be sent out to clients and … Read more