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

Method doConnect

packages/socket.io/lib/client.ts:156–168  ·  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

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

Callers 1

connectMethod · 0.95

Calls 2

_addMethod · 0.80
ofMethod · 0.45

Tested by

no test coverage detected