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

Method reconnect

src/remote/SessionsWebSocket.ts:393–403  ·  view source on GitHub ↗

* Force reconnect - closes existing connection and establishes a new one. * Useful when the subscription becomes stale (e.g., after container shutdown).

()

Source from the content-addressed store, hash-verified

391 * Useful when the subscription becomes stale (e.g., after container shutdown).
392 */
393 reconnect(): void {
394 logForDebugging('[SessionsWebSocket] Force reconnecting')
395 this.reconnectAttempts = 0
396 this.sessionNotFoundRetries = 0
397 this.close()
398 // Small delay before reconnecting (stored in reconnectTimer so it can be cancelled)
399 this.reconnectTimer = setTimeout(() => {
400 this.reconnectTimer = null
401 void this.connect()
402 }, 500)
403 }
404}
405

Callers

nothing calls this directly

Calls 3

closeMethod · 0.95
connectMethod · 0.95
logForDebuggingFunction · 0.85

Tested by

no test coverage detected