MCPcopy
hub / github.com/socketio/socket.io / rooms

Method rooms

packages/socket.io/lib/socket.ts:934–936  ·  view source on GitHub ↗

* Returns the rooms the socket is currently in. * * @example * io.on("connection", (socket) => { * console.log(socket.rooms); // Set { <socket.id> } * * socket.join("room1"); * * console.log(socket.rooms); // Set { <socket.id>, "room1" } * });

()

Source from the content-addressed store, hash-verified

932 * });
933 */
934 public get rooms(): Set<Room> {
935 return this.adapter.socketRooms(this.id) || new Set();
936 }
937
938 /**
939 * Adds a listener that will be fired when any event is received. The event name is passed as the first argument to

Callers

nothing calls this directly

Calls 1

socketRoomsMethod · 0.80

Tested by

no test coverage detected