* Initializes transport to use and starts probe. * * @private
()
| 527 | * @private |
| 528 | */ |
| 529 | private _open() { |
| 530 | if (this.transports.length === 0) { |
| 531 | class="cm">// Emit error on next tick so it can be listened to |
| 532 | this.setTimeoutFn(() => { |
| 533 | this.emitReserved(class="st">"error", class="st">"No transports available"); |
| 534 | }, 0); |
| 535 | return; |
| 536 | } |
| 537 | |
| 538 | const transportName = |
| 539 | this.opts.rememberUpgrade && |
| 540 | SocketWithoutUpgrade.priorWebsocketSuccess && |
| 541 | this.transports.indexOf(class="st">"websocket") !== -1 |
| 542 | ? class="st">"websocket" |
| 543 | : this.transports[0]; |
| 544 | this.readyState = class="st">"opening"; |
| 545 | |
| 546 | const transport = this.createTransport(transportName); |
| 547 | transport.open(); |
| 548 | this.setTransport(transport); |
| 549 | } |
| 550 | |
| 551 | /** |
| 552 | * Sets the current transport. Disables the existing one (if any). |
no test coverage detected