MCPcopy Create free account
hub / github.com/Noumena-Network/code / reconnect

Method reconnect

src/remote/SessionsWebSocket.ts:392–402  ·  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

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

Callers

nothing calls this directly

Calls 3

closeMethod · 0.95
connectMethod · 0.95
logForDebuggingFunction · 0.50

Tested by

no test coverage detected