Reputation: 1117
Everything in the title.
io.on('connection', (socket) => {
socket.join('somepool');
// Here I want to know how many socket's connections are opened in the given pool
// Something like:
io.in('somepool').length;
});
Upvotes: 0
Views: 54
Reputation: 3879
You can use io.sockets.clients('somepool')
to get all the clients connected and io.sockets.clients('somepool').length
to get the number of connections.
Upvotes: 1