* "Opens" the socket. * * @example * const socket = io({ * autoConnect: false * }); * * socket.connect();
()
| 354 | * socket.connect(); |
| 355 | */ |
| 356 | public connect(): this { |
| 357 | if (this.connected) return this; |
| 358 | |
| 359 | this.subEvents(); |
| 360 | if (!this.io[class="st">"_reconnecting"]) this.io.open(); class="cm">// ensure open |
| 361 | if (class="st">"open" === this.io._readyState) this.onopen(); |
| 362 | return this; |
| 363 | } |
| 364 | |
| 365 | /** |
| 366 | * Alias for {@link connect()}. |
no test coverage detected