mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
This commit adds the following methods:
- fetchSockets: return the matching socket instances
- addSockets: make the matching socket instances join the specified rooms
- delSockets: make the matching socket instances leave the specified rooms
- disconnectSockets: disconnect the matching socket instances
Those methods will then be exposed by the Socket.IO server:
```js
// clear room
io.socketsLeave("room1");
// disconnect all sockets in room
io.in("room2").disconnectSockets();
// fetch socket instances in room
io.in("room3").fetchSockets();
```
This feature will also be extended in the Redis adapter to handle
multiple Socket.IO servers.