From c2c103ba61ec1462e2ef69a3f144ecfe6aeb4ebd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 21 Aug 2009 17:44:34 +0000 Subject: [PATCH] Web output instance added --- .../handler/network/tcp/class_TcpNetworkPackageHandler.php | 5 ++++- application/hub/main/listener/tcp/class_TcpListener.php | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/application/hub/main/handler/network/tcp/class_TcpNetworkPackageHandler.php b/application/hub/main/handler/network/tcp/class_TcpNetworkPackageHandler.php index f2544adcd..c42684b1f 100644 --- a/application/hub/main/handler/network/tcp/class_TcpNetworkPackageHandler.php +++ b/application/hub/main/handler/network/tcp/class_TcpNetworkPackageHandler.php @@ -70,8 +70,11 @@ class TcpNetworkPackageHandler extends BaseNetworkPackageHandler implements Netw // Reset error code to unhandled $this->setErrorCode(self::SOCKET_ERROR_UNHANDLED); + // Debug message + $this->debugOutput('HANDLER: Handling TCP package from client ' . $resource); + // Read the raw data from socket - $rawData = socket_read($resource, 1500, PHP_BINARY_READ); + $rawData = socket_read($resource, 1500, PHP_NORMAL_READ); // Is it valid? if (($rawData === false) || (socket_last_error($resource) > 0)) { diff --git a/application/hub/main/listener/tcp/class_TcpListener.php b/application/hub/main/listener/tcp/class_TcpListener.php index 8002d4a09..9773fc871 100644 --- a/application/hub/main/listener/tcp/class_TcpListener.php +++ b/application/hub/main/listener/tcp/class_TcpListener.php @@ -185,6 +185,9 @@ class TcpListener extends BaseListener implements Listenable { // Then accept it $newSocket = socket_accept($this->getSocketResource()); + // Debug message + $this->debugOutput('LISTENER: Adding new client: ' . $newSocket); + // Add it to the clients $this->getPoolInstance()->addClient($newSocket); } // END - if -- 2.39.5