From 09a2fb8f8127cd2f168f49c7101b68cdc5221834 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Mon, 14 Nov 2011 16:43:52 -0500 Subject: [PATCH] Server app cleanup --- lib/Ratchet/Application/Server/App.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/Ratchet/Application/Server/App.php b/lib/Ratchet/Application/Server/App.php index 538594d..3d72ad0 100644 --- a/lib/Ratchet/Application/Server/App.php +++ b/lib/Ratchet/Application/Server/App.php @@ -57,13 +57,8 @@ class App implements ApplicationInterface { $host->set_nonblock(); declare(ticks = 1); - if (false === ($host->bind($address, (int)$port))) { - throw new Exception($host); - } - - if (false === ($host->listen())) { - throw new Exception($host); - } + $host->bind($address, (int)$port); + $host->listen(); do { $changed = $this->_resources; @@ -104,8 +99,6 @@ class App implements ApplicationInterface { $res = $this->onClose($conn); } } - } catch (Exception $se) { - $res = $this->onError($se->getSocket(), $se); // Just in case...but I don't think I need to do this } catch (\Exception $e) { $res = $this->onError($conn, $e); } @@ -114,6 +107,7 @@ class App implements ApplicationInterface { try { $new_res = $res->execute($this); } catch (\Exception $e) { + break; // trigger new error // $new_res = $this->onError($e->getSocket()); ??? // this is dangerous territory...could get in an infinte loop...Exception might not be Ratchet\Exception...$new_res could be ActionInterface|Composite|NULL...