* `Socket` constructor.
(io: Manager, nsp: string, opts?: Partial<SocketOptions>)
| 277 | * `Socket` constructor. |
| 278 | */ |
| 279 | constructor(io: Manager, nsp: string, opts?: Partial<SocketOptions>) { |
| 280 | super(); |
| 281 | this.io = io; |
| 282 | this.nsp = nsp; |
| 283 | if (opts && opts.auth) { |
| 284 | this.auth = opts.auth; |
| 285 | } |
| 286 | this._opts = Object.assign({}, opts); |
| 287 | if (this.io._autoConnect) this.open(); |
| 288 | } |
| 289 | |
| 290 | /** |
| 291 | * Whether the socket is currently disconnected |