Send a control message and wait for its `ack` (matched by `id`).
(frame: { type: string; id: string; payload: unknown }, timeoutMs: number)
| 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 }> { |
no test coverage detected