MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / disconnect

Method disconnect

packages/event-service/src/client.ts:247–265  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

245
246 ws.addEventListener('message', (event: MessageEvent) => {
247 if (this.ws !== ws) return;
248 this.handleMessage(event.data as string);
249 });
250
251 ws.addEventListener('close', () => {
252 if (this.ws !== ws) return;
253 this.connected = false;
254 this.stopPing();
255 this.clearHandshakeTimer();
256 if (!this.destroyed) {
257 this.scheduleReconnect();
258 }
259 });
260
261 ws.addEventListener('error', () => {
262 if (this.ws !== ws) return;
263 // error is always followed by close, so we only need to reject the
264 // connect promise here if we never opened. The browser does not expose
265 // the HTTP status of a failed upgrade, so reconnect and reserve auth
266 // recovery for the preceding connection-ticket HTTP request.
267 if (!this.connected) {
268 settleReject(new Error('WebSocket connection failed'));

Callers 15

client.test.tsFile · 0.80
CodeReviewStreamViewFunction · 0.80
useXtermPtyFunction · 0.80
SystemTopologyFunction · 0.80
useScrollSpyFunction · 0.80
useCloudAgentTerminalFunction · 0.80
ChildSessionDrawerFunction · 0.80
CloudChatPageFunction · 0.80
handleStreamErrorFunction · 0.80
connectWsFunction · 0.80
interruptFunction · 0.80
destroyFunction · 0.80

Calls 3

clearHandshakeTimerMethod · 0.95
stopPingMethod · 0.95
closeMethod · 0.65

Tested by

no test coverage detected