From 5e90fdc9f5c5c43eb8a7f1c82bc58d9320a3b395 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 3 Dec 2020 09:07:08 +0100 Subject: [PATCH] Continued: - removed no longer needed config entry - used StorableSocket::SOCKET_PROTOCOL_TCP instead of direct 'tcp' - improved some exception messages a bit MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../hub/classes/container/socket/class_SocketContainer.php | 6 +++--- .../hub/classes/factories/socket/class_SocketFactory.php | 2 +- .../handler/raw_data/tcp/class_TcpRawDataHandler.php | 2 +- application/hub/config.php | 3 --- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/application/hub/classes/container/socket/class_SocketContainer.php b/application/hub/classes/container/socket/class_SocketContainer.php index af36ce2d1..b35386050 100644 --- a/application/hub/classes/container/socket/class_SocketContainer.php +++ b/application/hub/classes/container/socket/class_SocketContainer.php @@ -151,16 +151,16 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita */ public static final function createSocketContainer ($socketResource, string $socketProtocol, DeliverablePackage $packageInstance, string $socketType) { // Validate parameter - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-CONTAINER: socketResource[%s]=%s,socketProtocol=%s,packageInstance[]=%s,socketType=%s - CALLED!', gettype($socketResource), $socketResource, $socketProtocol, gettype($packageInstance), $socketType)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-CONTAINER: socketResource[%s]=%s,socketProtocol=%s,packageInstance=%s,socketType=%s - CALLED!', gettype($socketResource), $socketResource, $socketProtocol, $packageInstance->__toString(), $socketType)); if (!is_resource($socketResource)) { // Throw exception throw new InvalidArgumentException(sprintf('socketResource[]=%s is not valid', $socketResource)); } elseif (empty($socketProtocol)) { // Throw again - throw new InvalidArgumentException('socketProtocol is empty'); + throw new InvalidArgumentException('Parameter "socketProtocol" is empty'); } elseif (empty($socketType)) { // Throw again - throw new InvalidArgumentException('socketType is empty'); + throw new InvalidArgumentException('Parameter "socketType" is empty'); } // Get a new instance diff --git a/application/hub/classes/factories/socket/class_SocketFactory.php b/application/hub/classes/factories/socket/class_SocketFactory.php index 91f83e676..0180d652c 100644 --- a/application/hub/classes/factories/socket/class_SocketFactory.php +++ b/application/hub/classes/factories/socket/class_SocketFactory.php @@ -474,7 +474,7 @@ class SocketFactory extends ObjectFactory { throw new InvalidArgumentException(sprintf('socketResource[]=%s is not valid', gettype($socketResource))); } elseif (empty($socketProtocol)) { // Throw it again - throw new InvalidArgumentException('socketProtocol is empty'); + throw new InvalidArgumentException('Parameter "socketProtocol" is empty'); } // Create package instance diff --git a/application/hub/classes/handler/raw_data/tcp/class_TcpRawDataHandler.php b/application/hub/classes/handler/raw_data/tcp/class_TcpRawDataHandler.php index 773625ff7..a979a0344 100644 --- a/application/hub/classes/handler/raw_data/tcp/class_TcpRawDataHandler.php +++ b/application/hub/classes/handler/raw_data/tcp/class_TcpRawDataHandler.php @@ -53,7 +53,7 @@ class TcpRawDataHandler extends BaseRawDataHandler implements Networkable { parent::__construct(__CLASS__); // Set handler name - $this->setHandlerName('tcp'); + $this->setHandlerName(StorableSocket::SOCKET_PROTOCOL_TCP); } /** diff --git a/application/hub/config.php b/application/hub/config.php index 56d70f508..08245c48a 100644 --- a/application/hub/config.php +++ b/application/hub/config.php @@ -796,9 +796,6 @@ $cfg->setConfigEntry('file_socket_listen_backlog', 0); // CFG: TCP-SOCKET-LISTEN-BACKLOG $cfg->setConfigEntry('tcp_socket_listen_backlog', 1000); -// CFG: NODE-STATE-CHECKED-PACKAGE-CLASS -$cfg->setConfigEntry('node_state_checked_package_class', 'NewConnectionNodeState'); - // CFG: EXTERNAL-ADDRESS $cfg->setConfigEntry('external_address', ''); -- 2.39.5