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

Method join

packages/socket.io/lib/socket.ts:461–468  ·  packages/socket.io/lib/socket.ts::Socket.join

* Joins a room. * * @example * io.on("connection", (socket) => { * // join a single room * socket.join("room1"); * * // join multiple rooms * socket.join(["room1", "room2"]); * }); * * @param {String|Array} rooms - room or array of rooms * @return a Promis

(rooms: Room | Array<Room>)

Source from the content-addressed store, hash-verified

459 * @return a Promise or nothing, depending on the adapter
460 */
461 public join(rooms: Room | Array<Room>): Promise<void> | void {
462 debug(class="st">"join room %s", rooms);
463
464 return this.adapter.addAll(
465 this.id,
466 new Set(Array.isArray(rooms) ? rooms : [rooms]),
467 );
468 }
469
470 /**
471 * Leaves a room.

Callers 15

constructorMethod · 0.95
_onconnectMethod · 0.95
addCookiesMethod · 0.45
newRequestFunction · 0.45
fixtureFunction · 0.45
encodePayloadFunction · 0.45
worker.jsFile · 0.45
encodePayloadFunction · 0.45
engine.io.jsFile · 0.45
fixtureFunction · 0.45
server.jsFile · 0.45
index.tsFile · 0.45

Calls 2

debugFunction · 0.85
addAllMethod · 0.80

Tested by 1

itFunction · 0.36