src/exchanges/gemini-client.js
/**
   * Close the underlying connction, which provides a way to reset the things
   */
Close the underlying connction, which provides a way to reset the things
Close the underlying connction which provides a way to reset the things
_close(subscription) {
    if (subscription && subscription.wss) {
      try {
        subscription.wss.close();
      } catch (ex) {
        if (ex.message === "WebSocket was closed before the connection was established") return;
        this.emit("error", ex);
      }
      subscription.wss = undefined;
      this._stopReconnectWatcher(subscription);
    } else {
      this._subscriptions.forEach(sub => this._close(sub));
      this._subscriptions = new Map();
    }
  }
_close ( subscription ) { if ( subscription && subscription . wss ) { try { subscription . wss . close ( ) ; } catch ( ex ) { if ( ex . message === "WebSocket was closed before the connection was established" ) return ; this . emit ( "error" , ex ) ; } subscription . wss = undefined ; this . _stopReconnectWatcher ( subscription ) ; } else { this . _subscriptions . forEach ( sub => this . _close ( sub ) ) ; this . _subscriptions = new Map ( ) ; } }
Close the underlying connction, which provides a way to reset the things
Close the underlying connction which provides a way to reset the things