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

Method disconnect

packages/socket.io/lib/socket.ts:712–721  ·  packages/socket.io/lib/socket.ts::Socket.disconnect

* Disconnects this client. * * @example * io.on("connection", (socket) => { * // disconnect this socket (the connection might be kept alive for other namespaces) * socket.disconnect(); * * // disconnect this socket and close the underlying connection * socket.disconne

(close = false)

Source from the content-addressed store, hash-verified

710 * @return self
711 */
712 public disconnect(close = false): this {
713 if (!this.connected) return this;
714 if (close) {
715 this.client._disconnect();
716 } else {
717 this.packet({ type: PacketType.DISCONNECT });
718 this._onclose(class="st">"server namespace disconnect");
719 }
720 return this;
721 }
722
723 /**
724 * Sets the compress flag.

Callers 7

_disconnectMethod · 0.45
utility-methods.tsFile · 0.45
socket.tsFile · 0.45
uws.tsFile · 0.45
closeFunction · 0.45
namespaces.tsFile · 0.45
successFunction · 0.45

Calls 3

packetMethod · 0.95
_oncloseMethod · 0.95
_disconnectMethod · 0.80

Tested by

no test coverage detected