Reputation: 222889
Is there a way to find what rooms a client joined?
The situation I am trying to solve is the following: people can join different rooms, but I want to notify people in the room if the person leaves. I know that I have to use on disconnect
event and emit the message to all people in that room, but I can not find a way to know what rooms the person is in.
io.sockets.on('connection', function(client) {
client.on('disconnect', function() {
// ...
});
});
Upvotes: 0
Views: 782