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

Method onclose

packages/socket.io-client/lib/manager.ts:557–569  ·  view source on GitHub ↗

* Called when: * * - the low-level engine is closed * - the parser encountered a badly formatted packet * - all sockets are disconnected * * @private

(reason: string, description?: DisconnectDescription)

Source from the content-addressed store, hash-verified

555 * @private
556 */
557 private onclose(reason: string, description?: DisconnectDescription): void {
558 debug("closed due to %s", reason);
559
560 this.cleanup();
561 this.engine?.close();
562 this.backoff.reset();
563 this._readyState = "closed";
564 this.emitReserved("close", reason, description);
565
566 if (this._reconnection && !this.skipReconnect) {
567 this.reconnect();
568 }
569 }
570
571 /**
572 * Attempt a reconnection.

Callers 2

ondataMethod · 0.95
_closeMethod · 0.95

Calls 4

cleanupMethod · 0.95
reconnectMethod · 0.95
debugFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected