()
| 8904 | ws == null ? void 0 : ws.close(); |
| 8905 | ws = null; |
| 8906 | term.clear(); |
| 8907 | connect(); |
| 8908 | } |
| 8909 | function startPing() { |
| 8910 | stopPing(); |
| 8911 | pingTimer = setInterval(() => { |
| 8912 | if ((ws == null ? void 0 : ws.readyState) === WebSocket.OPEN) { |
| 8913 | lastPingSent = Date.now(); |
| 8914 | sendJSON({ type: "ping" }); |
| 8915 | } |
| 8916 | }, PING_INTERVAL_MS); |
| 8917 | } |