+ do {
+ try {
+ $tryAgain = false;
+ $this->connect($this->config->host, $this->config->port);
+ $this->init();
+ $this->loop();
+ } catch (Exception_ConnectionReset $e) {
+ $tryAgain = true;
+ //connection is refused directly after a connection reset
+ //hopefully waiting a bit will help
+ sleep(10);
+ }
+ } while ($tryAgain);