MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / _onClose

Method _onClose

packages/server-e2e/src/ws.ts:242–259  ·  view source on GitHub ↗
(code: number, reason: string)

Source from the content-addressed store, hash-verified

240 }
241
242 private _onClose(code: number, reason: string): void {
243 this._closed = true;
244 this._closeReason = { code, reason };
245 recordReportEvent(
246 {
247 kind: 'ws',
248 direction: 'lifecycle',
249 url: this.opts.url,
250 message: 'close',
251 frame: { code, reason },
252 },
253 { reportDir: this.opts.reportDir },
254 );
255 for (const w of this._waiters.splice(0)) {
256 w.reject(new Error(`ws closed (code=${code}) before matching frame arrived`));
257 }
258 for (const w of this._closeWaiters.splice(0)) w(this._closeReason);
259 }
260}
261
262function pingNonce(frame: AnyFrame): string {

Callers 1

openMethod · 0.95

Calls 2

recordReportEventFunction · 0.85
rejectMethod · 0.65

Tested by

no test coverage detected