Hi,
I am creating unique room while Group calling, i want to know if same socket already connected or joined in other rooms, i mean want to filter socket id in all rooms, please let me know if there is any method to check socket id in all created rooms ?
io.on('connection', function(socket){
socket.join('room1');
console.log(socket.rooms); // contains an object with all of the roomnames as keys and values
})
For me the log shows the same output before and after the call to join a room, i.e. the room "mychannel" doesn't show up in socket.rooms
, any idea why is that the case?
console.log(socket.rooms);
socket.join("mychannel");
console.log(socket.rooms);
Most helpful comment