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

Method onconnect

packages/socket.io-client/lib/socket.ts:829–838  ·  view source on GitHub ↗

* Called upon server connect. * * @private

(id: string, pid: string)

Source from the content-addressed store, hash-verified

827 * @private
828 */
829 private onconnect(id: string, pid: string) {
830 debug("socket connected with id %s", id);
831 this.id = id;
832 this.recovered = pid && this._pid === pid;
833 this._pid = pid; // defined only if connection state recovery is enabled
834 this.connected = true;
835 this.emitBuffered();
836 this._drainQueue(true);
837 this.emitReserved("connect");
838 }
839
840 /**
841 * Emit buffered events (received and emitted).

Callers 1

onpacketMethod · 0.95

Calls 3

emitBufferedMethod · 0.95
_drainQueueMethod · 0.95
debugFunction · 0.85

Tested by

no test coverage detected