private void onclose(String reason) {
        logger.fine("close");
        this.cleanup();
        this.readyState = ReadyState.CLOSED;
        this.emit(EVENT_CLOSE, reason);
        if (this._reconnection && !this.skipReconnect) {
            this.reconnect();
        }
    }