Thursday, 18 May 2017

How to manually remove all sockets from the room. Socket.io 2

I can access array of socket id`s in this object:

const socketsInRomm = io.sockets.adapter.rooms[<Room ID>]

How to remove all sockets from the room by socket ID ?

I know that i can remove socket by calling socket.leave() but in some cases i need to clean up manually whole room.



via Tomas Rastenis

No comments:

Post a Comment