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