()
| 84 | } |
| 85 | |
| 86 | private startConnectLoop() { |
| 87 | // if connected, trying to connect, or the internalId is already set, do nothing |
| 88 | if (this.#connectIntervalId !== null || this.#connected) return |
| 89 | this.debugLog(`Starting connect loop (every ${this.#connectEveryMs}ms)`) |
| 90 | |
| 91 | this.#connectIntervalId = setInterval( |
| 92 | this.#retryConnection, |
| 93 | this.#connectEveryMs, |
| 94 | ) as unknown as number |
| 95 | } |
| 96 | |
| 97 | private stopConnectLoop() { |
| 98 | this.#connecting = false |