MCPcopy Index your code
hub / github.com/socketio/socket.io / _onconnect

Method _onconnect

lib/socket.ts:601–613  ·  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

599 * @private
600 */
601 _onconnect(): void {
602 debug("socket connected - writing packet");
603 this.connected = true;
604 this.join(this.id);
605 if (this.conn.protocol === 3) {
606 this.packet({ type: PacketType.CONNECT });
607 } else {
608 this.packet({
609 type: PacketType.CONNECT,
610 data: { sid: this.id, pid: this.pid },
611 });
612 }
613 }
614
615 /**
616 * Called with each packet. Called by `Client`.

Callers 1

_doConnectMethod · 0.80

Calls 2

joinMethod · 0.95
packetMethod · 0.95

Tested by

no test coverage detected