public function onFailureEv($bev = null)
    {
        try {
            if (!$this->connected && !$this->failed) {
                $this->failed = true;
                $this->onFailure();
            }
            $this->connected = false;
        } catch (\Exception $e) {
            Daemon::uncaughtExceptionHandler($e);
        }
    }