From a1c27ac91b7a07326785acf4ad0bfeb03d0488ef Mon Sep 17 00:00:00 2001 From: Gerrit Drost Date: Fri, 23 May 2014 16:21:13 +0200 Subject: [PATCH] Added the property socket to the IOServer class and exposed the app and socket properties through getters. --- src/Ratchet/Server/IoServer.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/Ratchet/Server/IoServer.php b/src/Ratchet/Server/IoServer.php index b27ee93..587dcd5 100644 --- a/src/Ratchet/Server/IoServer.php +++ b/src/Ratchet/Server/IoServer.php @@ -1,5 +1,7 @@ loop = $loop; $this->app = $app; + $this->socket = $socket; $socket->on('connection', array($this, 'handleConnect')); @@ -50,6 +59,24 @@ class IoServer { $this->handlers[1] = array($this, 'handleEnd'); $this->handlers[2] = array($this, 'handleError'); } + + /** + * Returns the Ratchet App + * + * @return \Ratchet\MessageComponentInterface + */ + public function getApp() { + return $this->app; + } + + /** + * Returns the Socket + * + * @return \React\Socket\ServerInterface + */ + public function getSocket() { + return $this->socket; + } /** * @param \Ratchet\MessageComponentInterface $component The application that I/O will call when events are received