* Connects a client to a namespace. * * @param name - the namespace * @param {Object} auth - the auth parameters * * @private
(name: string, auth: Record<string, unknown>)
| 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. |