From 62962bb27f5f9c9bfb0c19216f51a6eefb816079 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Mon, 21 Nov 2011 11:02:04 -0500 Subject: [PATCH] Removed legacy code Removed all traces of ObserverInterface Added getRemoteAddress method to socket --- .../Application/ApplicationInterface.php | 2 +- lib/Ratchet/ObserverInterface.php | 41 ------------------- .../Resource/Command/CommandInterface.php | 2 +- lib/Ratchet/Socket.php | 9 ++++ lib/Ratchet/SocketInterface.php | 7 ++++ 5 files changed, 18 insertions(+), 43 deletions(-) delete mode 100644 lib/Ratchet/ObserverInterface.php diff --git a/lib/Ratchet/Application/ApplicationInterface.php b/lib/Ratchet/Application/ApplicationInterface.php index 0666995..00da591 100644 --- a/lib/Ratchet/Application/ApplicationInterface.php +++ b/lib/Ratchet/Application/ApplicationInterface.php @@ -5,7 +5,7 @@ use Ratchet\Resource\Connection; interface ApplicationInterface { /** * Decorator pattern - * @param Ratchet\ObserverInterface Application to wrap in protocol + * @param Ratchet\ApplicationInterface Application to wrap in protocol * @throws UnexpectedValueException */ public function __construct(ApplicationInterface $app = null); diff --git a/lib/Ratchet/ObserverInterface.php b/lib/Ratchet/ObserverInterface.php deleted file mode 100644 index ca87e95..0000000 --- a/lib/Ratchet/ObserverInterface.php +++ /dev/null @@ -1,41 +0,0 @@ -getResource(), $address, $port)) { + throw new Exception; + } + + return $address; + } + public function get_option($level, $optname) { if (false === ($res = @socket_get_option($this->getResource(), $level, $optname))) { throw new Exception; diff --git a/lib/Ratchet/SocketInterface.php b/lib/Ratchet/SocketInterface.php index e95e3a1..3f0a1e1 100644 --- a/lib/Ratchet/SocketInterface.php +++ b/lib/Ratchet/SocketInterface.php @@ -54,6 +54,13 @@ interface SocketInterface { */ function connect($address, $port = 0); + /** + * Get the address the socket connected from + * @return string + * @throws Exception + */ + function getRemoteAddress(); + /** * @param int * @param int