()
| 554 | } |
| 555 | |
| 556 | close(): void { |
| 557 | // Clear any pending reconnection timer |
| 558 | if (this.reconnectTimer) { |
| 559 | clearTimeout(this.reconnectTimer) |
| 560 | this.reconnectTimer = null |
| 561 | } |
| 562 | |
| 563 | // Clear ping and keepalive intervals |
| 564 | this.stopPingInterval() |
| 565 | this.stopKeepaliveInterval() |
| 566 | |
| 567 | // Unregister session activity callback |
| 568 | unregisterSessionActivityCallback() |
| 569 | |
| 570 | this.state = 'closing' |
| 571 | this.doDisconnect() |
| 572 | } |
| 573 | |
| 574 | private replayBufferedMessages(lastId: string): void { |
| 575 | const messages = this.messageBuffer.toArray() |
no test coverage detected