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

Method _onconnect

packages/socket.io/lib/socket.ts:508–520  ·  view source on GitHub ↗

* Called by `Namespace` upon successful * middleware execution (ie: authorization). * Socket is added to namespace array before * call to join, so adapters can access it. * * @private

()

Source from the content-addressed store, hash-verified

506 * @private
507 */
508 _onconnect(): void {
509 debug("socket connected - writing packet");
510 this.connected = true;
511 this.join(this.id);
512 if (this.conn.protocol === 3) {
513 this.packet({ type: PacketType.CONNECT });
514 } else {
515 this.packet({
516 type: PacketType.CONNECT,
517 data: { sid: this.id, pid: this.pid },
518 });
519 }
520 }
521
522 /**
523 * Called with each packet. Called by `Client`.

Callers 1

_doConnectMethod · 0.80

Calls 3

joinMethod · 0.95
packetMethod · 0.95
debugFunction · 0.85

Tested by

no test coverage detected