(st: ConnState | undefined)
| 442 | } |
| 443 | |
| 444 | function cleanupConn(st: ConnState | undefined): void { |
| 445 | if (!st) return |
| 446 | if (st.pinger) clearInterval(st.pinger) |
| 447 | if (st.ws && st.ws.readyState <= WebSocket.OPEN) { |
| 448 | try { |
| 449 | st.ws.close() |
| 450 | } catch { |
| 451 | // already closing |
| 452 | } |
| 453 | } |
| 454 | st.ws = undefined |
| 455 | } |
| 456 |
no test coverage detected