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

Method sendAndAwaitAck

packages/server-e2e/src/ws.ts:162–168  ·  view source on GitHub ↗

Send a control message and wait for its `ack` (matched by `id`).

(frame: { type: string; id: string; payload: unknown }, timeoutMs: number)

Source from the content-addressed store, hash-verified

160
161 /** Send a control message and wait for its `ack` (matched by `id`). */
162 async sendAndAwaitAck(frame: { type: string; id: string; payload: unknown }, timeoutMs: number): Promise<AnyFrame> {
163 this.send(frame);
164 return this.waitForFrame(
165 (f) => f.type === 'ack' && f.id === frame.id,
166 timeoutMs,
167 );
168 }
169
170 /** Resolves when the socket closes (or immediately if already closed). */
171 closed(): Promise<{ code: number; reason: string }> {

Callers 4

connectMethod · 0.95
subscribeMethod · 0.80
unsubscribeMethod · 0.80
_sendWsControlMethod · 0.80

Calls 2

sendMethod · 0.95
waitForFrameMethod · 0.95

Tested by

no test coverage detected