()
| 299 | } |
| 300 | |
| 301 | private startPingInterval(): void { |
| 302 | this.stopPingInterval() |
| 303 | |
| 304 | this.pingInterval = setInterval(() => { |
| 305 | if (this.ws && this.state === 'connected') { |
| 306 | try { |
| 307 | this.ws.ping?.() |
| 308 | } catch { |
| 309 | // Ignore ping errors, close handler will deal with connection issues |
| 310 | } |
| 311 | } |
| 312 | }, PING_INTERVAL_MS) |
| 313 | } |
| 314 | |
| 315 | /** |
| 316 | * Stop ping interval |
no test coverage detected