(message: string)
| 562 | } |
| 563 | |
| 564 | private close(message: string): void { |
| 565 | if (this.closed) { |
| 566 | return |
| 567 | } |
| 568 | this.closed = true |
| 569 | for (const pending of this.pendingRequests.values()) { |
| 570 | pending.reject(new Error(message)) |
| 571 | } |
| 572 | this.pendingRequests.clear() |
| 573 | this.events.pushLossless({ type: 'disconnected', message }) |
| 574 | this.events.close() |
| 575 | try { |
| 576 | this.ws?.close() |
| 577 | } catch {} |
| 578 | } |
| 579 | } |
no test coverage detected