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

Function _doConnect

packages/socket.io-cluster-engine/lib/engine.ts:668–690  ·  view source on GitHub ↗
(socket: Socket)

Source from the content-addressed store, hash-verified

666 }
667
668 private _doConnect(socket: Socket) {
669 if (!socket[kDelayed] || socket.readyState !== "open") {
670 return;
671 }
672 debug(
673 "the client has not upgraded yet, so the connection process is completed here",
674 );
675 socket[kDelayed] = false;
676 socket.off("packet", socket[kPacketListener]);
677 clearTimeout(socket[kDelayedTimer]);
678
679 super.emit("connection", socket);
680
681 socket[kBuffer].forEach((packet: Packet) => {
682 // @ts-expect-error onPacket() method is private
683 socket.onPacket(packet);
684 });
685 delete socket[kBuffer];
686
687 if (socket.upgraded) {
688 socket.emit("upgrade");
689 }
690 }
691
692 abstract publishMessage(message: Message): void;
693}

Callers

nothing calls this directly

Calls 3

debugFunction · 0.85
emitMethod · 0.65
onPacketMethod · 0.45

Tested by

no test coverage detected