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

Method disconnect

lib/socket.ts:805–814  ·  view source on GitHub ↗

* 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

803 * @return self
804 */
805 public disconnect(close = false): this {
806 if (!this.connected) return this;
807 if (close) {
808 this.client._disconnect();
809 } else {
810 this.packet({ type: PacketType.DISCONNECT });
811 this._onclose("server namespace disconnect");
812 }
813 return this;
814 }
815
816 /**
817 * 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