Answer the question
In order to leave comments, you need to log in
How to disable all room clients in socket.io?
Hello. I have two rooms with clients. The namespace is the standard "/".
I need to turn off one room with clients entirely, or turn off clients one by one knowing their id.
Here is what I have at the moment
// Получаю объекты сокетов в комнате
var room = io.sockets.adapter.rooms['clients']
console.log(room) // Room { sockets: { kCUjAOSH5UIrZ5mAAAAA: true }, length: 1 }
// Достаю ID всех сокетов комнаты
var socketsID = Object.keys(room.sockets)
console.log(socketsID) // [ 'kCUjAOSH5UIrZ5mAAAAA' ]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question