src/wampy.js
/**
     * Internal websocket on close callback
     * @param {object} event
     * @private
     */
Internal websocket on close callback
@param {object} event
@private
Internal websocket on close callback @param { object } event @private
_wsOnClose (event) {
        this._log('[wampy] websocket disconnected. Info: ', event);
        if ((this._cache.sessionId || this._cache.reconnectingAttempts) &&
            this._options.autoReconnect &&
            (this._options.maxRetries === 0 ||
             this._cache.reconnectingAttempts < this._options.maxRetries) &&
            !this._cache.isSayingGoodbye) {
            this._cache.sessionId = null;
            this._cache.timer = setTimeout(() => {
                this._wsReconnect();
            }, this._options.reconnectInterval);
        } else {
            if (this._options.onClose) {
                this._options.onClose();
            }
            this._resetState();
            this._ws = null;
        }
    }
_wsOnClose ( event ) { this . _log ( '[wampy] websocket disconnected. Info: ' , event ) ; if ( ( this . _cache . sessionId || this . _cache . reconnectingAttempts ) && this . _options . autoReconnect && ( this . _options . maxRetries === 0 || this . _cache . reconnectingAttempts < this . _options . maxRetries ) && ! this . _cache . isSayingGoodbye ) { this . _cache . sessionId = null ; this . _cache . timer = setTimeout ( ( ) => { this . _wsReconnect ( ) ; } , this . _options . reconnectInterval ) ; } else { if ( this . _options . onClose ) { this . _options . onClose ( ) ; } this . _resetState ( ) ; this . _ws = null ; } }
Internal websocket on close callback
 @param {object} event
 @private
Internal websocket on close callback @param { object } event @private
// Automatic reconnection // No reconnection needed or reached max retries count