Can I get a list of the rooms a client is connected to in socket.io?

无人久伴 提交于 2019-12-24 07:07:40

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!