lib/Endpoint.js
function(sourceWasAnError, shouldNotReconnect) {
      log.error("[Endpoint] Connection closed " + (sourceWasAnError ? 'because of an error:' + sourceWasAnError : ''));

      this.connected = false;
      this.handshaken = false;
      this.connecting = false;

      if (!shouldNotReconnect) {
        log.debug('onClose():: reconnecting...');
        this.handshakenBackoff.reset();
        this.reconnectBackoff.backoff();
      } else {
        log.debug('onClose():: don\'t reconnect');
        this.handshakenBackoff.reset();
        this.reconnectBackoff.reset();
      }

      this.emit('close', sourceWasAnError);
    }
function(sourceWasAnError, shouldNotReconnect) {
      log.error("[Endpoint] Connection closed " + (sourceWasAnError ? 'because of an error:' + sourceWasAnError : ''));

      this.connected = false;
      this.handshaken = false;
      this.connecting = false;

      if (!shouldNotReconnect) {
        log.debug('onClose():: reconnecting...');
        this.handshakenBackoff.reset();
        this.reconnectBackoff.backoff();
      } else {
        log.debug('onClose():: don\'t reconnect');
        this.handshakenBackoff.reset();
        this.reconnectBackoff.reset();
      }

      this.emit('close', sourceWasAnError);
    }
function ( sourceWasAnError , shouldNotReconnect ) { log . error ( "[Endpoint] Connection closed " + ( sourceWasAnError ? 'because of an error:' + sourceWasAnError : '' ) ) ; this . connected = false ; this . handshaken = false ; this . connecting = false ; if ( ! shouldNotReconnect ) { log . debug ( 'onClose():: reconnecting...' ) ; this . handshakenBackoff . reset ( ) ; this . reconnectBackoff . backoff ( ) ; } else { log . debug ( 'onClose():: don\'t reconnect' ) ; this . handshakenBackoff . reset ( ) ; this . reconnectBackoff . reset ( ) ; } this . emit ( 'close' , sourceWasAnError ) ; }
If the connection to redsmin just closed, try to reconnect
@param  {Error} err
@param {Boolean} true if after the on close the Endpoint should not reconnect
If the connection to redsmin just closed try to reconnect