MCPcopy
hub / github.com/codeaashu/claude-code / startPing

Function startPing

src/server/web/terminal.ts:296–304  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

294// ── Ping / latency ───────────────────────────────────────────────────────────
295
296function startPing(): void {
297 stopPing()
298 pingTimer = setInterval(() => {
299 if (ws?.readyState === WebSocket.OPEN) {
300 lastPingSent = Date.now()
301 sendJSON({ type: 'ping' })
302 }
303 }, PING_INTERVAL_MS)
304}
305
306function stopPing(): void {
307 if (pingTimer) clearInterval(pingTimer)

Callers 1

connectFunction · 0.70

Calls 2

stopPingFunction · 0.70
sendJSONFunction · 0.70

Tested by

no test coverage detected