1

Is it possible to get rooms of a client/socket? I would like to get all the clients in a room, and get all the rooms a client is connected to. Is both of those available out of the box in socket.io?

I can not find proper api/documentation.

Mia
  • 6,220
  • 12
  • 47
  • 81
  • this actually does ot answer my question; even if it did, it would answer only the half (still does not answer "how to get rooms of client"). – Mia Nov 08 '14 at 18:17
  • Since you can get a list of all the rooms and all the clients in all those rooms, you can work out backwards which rooms a particular client is subscribed to. The client id is `socket.id`. (sidenote: a client is always subscribed to a room name = its own id). The standard practice however is to manually keep a track of what rooms a client is subscribed to. – laggingreflex Nov 09 '14 at 01:52

0 Answers0