* Used to terminate a web socket * @param {string} endpoint - endpoint identifier associated with the web socket * @param {boolean} reconnect - auto reconnect after termination * @return {undefined}
(endpoint: string, reconnect = false)
| 1539 | * @return {undefined} |
| 1540 | */ |
| 1541 | terminate(endpoint: string, reconnect = false) { |
| 1542 | if (this.Options.verbose) this.Options.log('WebSocket terminating:', endpoint); |
| 1543 | const ws = this.subscriptions[endpoint]; |
| 1544 | if (!ws) return; |
| 1545 | ws.removeAllListeners('message'); |
| 1546 | ws.reconnect = reconnect; |
| 1547 | ws.terminate(); |
| 1548 | } |
| 1549 | |
| 1550 | /** |
| 1551 | * Connect to WebSocket API for bidirectional JSON-RPC communication |
no test coverage detected