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

Function disconnectSockets

packages/socket.io-adapter/lib/cluster-adapter.ts:550–568  ·  view source on GitHub ↗
(opts: BroadcastOptions, close: boolean)

Source from the content-addressed store, hash-verified

548 }
549
550 override async disconnectSockets(opts: BroadcastOptions, close: boolean) {
551 const onlyLocal = opts.flags?.local;
552
553 if (!onlyLocal) {
554 try {
555 await this.publishAndReturnOffset({
556 type: MessageType.DISCONNECT_SOCKETS,
557 data: {
558 opts: encodeOptions(opts),
559 close,
560 },
561 });
562 } catch (e) {
563 debug("[%s] error while publishing message: %s", this.uid, e.message);
564 }
565 }
566
567 super.disconnectSockets(opts, close);
568 }
569
570 async fetchSockets(opts: BroadcastOptions): Promise<any[]> {
571 const [localSockets, serverCount] = await Promise.all([

Callers

nothing calls this directly

Calls 3

encodeOptionsFunction · 0.85
debugFunction · 0.85
disconnectSocketsMethod · 0.45

Tested by

no test coverage detected