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

Method onopen

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

* Called upon transport open. * * @private

()

Source from the content-addressed store, hash-verified

391 * @private
392 */
393 private onopen(): void {
394 debug("open");
395
396 // clear old subs
397 this.cleanup();
398
399 // mark as open
400 this._readyState = "open";
401 this.emitReserved("open");
402
403 // add new subs
404 const socket = this.engine;
405 this.subs.push(
406 on(socket, "ping", this.onping.bind(this)),
407 on(socket, "data", this.ondata.bind(this)),
408 on(socket, "error", this.onerror.bind(this)),
409 on(socket, "close", this.onclose.bind(this)),
410 // @ts-ignore
411 on(this.decoder, "decoded", this.ondecoded.bind(this)),
412 );
413 }
414
415 /**
416 * Called upon a ping.

Callers 1

openMethod · 0.45

Calls 4

cleanupMethod · 0.95
onFunction · 0.90
debugFunction · 0.85
bindMethod · 0.80

Tested by

no test coverage detected