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

Function setOnClose

src/bridge/replBridgeTransport.ts:304–315  ·  view source on GitHub ↗
(cb)

Source from the content-addressed store, hash-verified

302 sse.setOnData(cb)
303 },
304 setOnClose(cb) {
305 onCloseCb = cb
306 // SSE reconnect-budget exhaustion fires onClose(undefined) — map to
307 // 4092 so ws_closed telemetry can distinguish it from HTTP-status
308 // closes (SSETransport:280 passes response.status). Stop CCRClient's
309 // heartbeat timer before notifying replBridge. (sse.close() doesn't
310 // invoke this, so the epoch-mismatch path above isn't double-firing.)
311 sse.setOnClose(code => {
312 ccr.close()
313 cb(code ?? 4092)
314 })
315 },
316 setOnConnect(cb) {
317 onConnectCb = cb
318 },

Callers

nothing calls this directly

Calls 2

setOnCloseMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected