问题
What it says at the top - for a given client, can I see what rooms they have joined?
Thanks
回答1:
Given a socket
you can get all the rooms it has joined via io.sockets.manager.roomClients[socket.id]
.
See here.
来源:https://stackoverflow.com/questions/16001850/can-i-get-a-list-of-the-rooms-a-client-is-connected-to-in-socket-io