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

Method doConnect

lib/client.ts:155–167  ·  view source on GitHub ↗

* Connects a client to a namespace. * * @param name - the namespace * @param {Object} auth - the auth parameters * * @private

(name: string, auth: Record<string, unknown>)

Source from the content-addressed store, hash-verified

153 * @private
154 */
155 private doConnect(name: string, auth: Record<string, unknown>): void {
156 const nsp = this.server.of(name);
157
158 nsp._add(this, auth, (socket) => {
159 this.sockets.set(socket.id, socket);
160 this.nsps.set(nsp.name, socket);
161
162 if (this.connectTimeout) {
163 clearTimeout(this.connectTimeout);
164 this.connectTimeout = undefined;
165 }
166 });
167 }
168
169 /**
170 * Disconnects from all namespaces and closes transport.

Callers 1

connectMethod · 0.95

Calls 2

ofMethod · 0.80
_addMethod · 0.80

Tested by

no test coverage detected