MCPcopy Create free account
hub / github.com/ccxt/node-binance-api / terminate

Method terminate

src/node-binance-api.ts:1541–1548  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 1

handleDepthStreamDataMethod · 0.95

Calls 2

logMethod · 0.80
terminateMethod · 0.65

Tested by

no test coverage detected