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