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

Method onopen

packages/socket.io-client/lib/manager.ts:393–413  ·  packages/socket.io-client/lib/manager.ts::Manager.onopen

* Called upon transport open. * * @private

()

Source from the content-addressed store, hash-verified

391 * @private
392 */
393 private onopen(): void {
394 debug(class="st">"open");
395
396 class="cm">// clear old subs
397 this.cleanup();
398
399 class="cm">// mark as open
400 this._readyState = class="st">"open";
401 this.emitReserved(class="st">"open");
402
403 class="cm">// add new subs
404 const socket = this.engine;
405 this.subs.push(
406 on(socket, class="st">"ping", this.onping.bind(this)),
407 on(socket, class="st">"data", this.ondata.bind(this)),
408 on(socket, class="st">"error", this.onerror.bind(this)),
409 on(socket, class="st">"close", this.onclose.bind(this)),
410 class="cm">// @ts-ignore
411 on(this.decoder, class="st">"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