(msg: unknown)
| 463 | } |
| 464 | |
| 465 | private send(msg: unknown): void { |
| 466 | if (!this.ws || this.ws.readyState !== WebSocket.OPEN) return; |
| 467 | try { |
| 468 | this.ws.send(JSON.stringify(msg)); |
| 469 | traceWsOut(msg); |
| 470 | } catch { |
| 471 | // Ignore send errors (socket closing races) |
| 472 | } |
| 473 | } |
| 474 | |
| 475 | private nextId(): string { |
| 476 | return `c_${++this.msgSeq}`; |
no test coverage detected