From 4bbb9bf548f37679aee5c1f0fce5a391d828447e Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sun, 28 Nov 2010 01:24:16 +0000 Subject: [PATCH] [TASK] Code working again. Introduced basic protocol handler structures. --- Classes/Client/AbstractClient.php | 4 ++-- Classes/Client/IrcClient.php | 1 + Testcode/Client/ClientManagerTest.php | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Classes/Client/AbstractClient.php b/Classes/Client/AbstractClient.php index 5188dce..a38fff3 100644 --- a/Classes/Client/AbstractClient.php +++ b/Classes/Client/AbstractClient.php @@ -41,11 +41,11 @@ abstract class Client_AbstractClient { * Forwards incoming data to the ProtocolParser. * Calls protected processData() * @param string $rawData - * @return void + * @return string */ public function processRawData($rawData) { $contentObject = $this->protocolHandler->parse($rawData); - $this->processContentObject($contentObject); + return $this->processContentObject($contentObject); } /** diff --git a/Classes/Client/IrcClient.php b/Classes/Client/IrcClient.php index 9b06ced..04dc713 100644 --- a/Classes/Client/IrcClient.php +++ b/Classes/Client/IrcClient.php @@ -33,6 +33,7 @@ class Client_IrcClient extends Client_AbstractClient { * @return string */ public function processContentObject($contentObject) { + var_dump($contentObject); $data = $contentObject->rawData; //echo "[RECV] ".$data; diff --git a/Testcode/Client/ClientManagerTest.php b/Testcode/Client/ClientManagerTest.php index 3f56f6d..f491433 100644 --- a/Testcode/Client/ClientManagerTest.php +++ b/Testcode/Client/ClientManagerTest.php @@ -1,6 +1,6 @@ registerProtocol("irc", "Client_IrcClient"); +$clientManager->registerProtocol("Irc", "Client_IrcClient"); $clientManager->registerProtocol("jpt", "Client_BotClient"); $freenode = $clientManager->createTcpConnection("freenode", "Irc"); @@ -30,9 +30,9 @@ $eloxoph = $clientManager->createTcpConnection("eloxoph", "irc"); $clientManager->attachConfig($config_eloxoph, $eloxoph); $eloxoph->connect("irc.eloxoph.com", 6667);*/ -$srv = $clientManager->createTcpConnection("srv", "jpt"); +/*$srv = $clientManager->createTcpConnection("srv", "jpt"); $srv->bind("localhost", 7777); -$srv->listen(); +$srv->listen();*/ while($clientManager->countConnections() > 0) { $clientManager->work();