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

Function addSockets

packages/socket.io-adapter/lib/cluster-adapter.ts:510–528  ·  view source on GitHub ↗
(opts: BroadcastOptions, rooms: Room[])

Source from the content-addressed store, hash-verified

508 }
509
510 override async addSockets(opts: BroadcastOptions, rooms: Room[]) {
511 const onlyLocal = opts.flags?.local;
512
513 if (!onlyLocal) {
514 try {
515 await this.publishAndReturnOffset({
516 type: MessageType.SOCKETS_JOIN,
517 data: {
518 opts: encodeOptions(opts),
519 rooms,
520 },
521 });
522 } catch (e) {
523 debug("[%s] error while publishing message: %s", this.uid, e.message);
524 }
525 }
526
527 super.addSockets(opts, rooms);
528 }
529
530 override async delSockets(opts: BroadcastOptions, rooms: Room[]) {
531 const onlyLocal = opts.flags?.local;

Callers

nothing calls this directly

Calls 3

encodeOptionsFunction · 0.85
debugFunction · 0.85
addSocketsMethod · 0.80

Tested by

no test coverage detected