(code = 1000, reason = 'Client closed')
| 145 | } |
| 146 | |
| 147 | close(code = 1000, reason = 'Client closed'): void { |
| 148 | this.manuallyClosed = true; |
| 149 | this.stopReconnect(); |
| 150 | if (!this.socket) { |
| 151 | return; |
| 152 | } |
| 153 | this.stopHeartbeat(); |
| 154 | try { |
| 155 | this.socket.close(code, reason); |
| 156 | } catch { |
| 157 | // ignore |
| 158 | } |
| 159 | this.socket = null; |
| 160 | } |
| 161 | |
| 162 | get resumeToken(): string | null { |
| 163 | return this.latestResumeToken; |
no test coverage detected