]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 3 Dec 2020 08:07:08 +0000 (09:07 +0100)
committerRoland Häder <roland@mxchange.org>
Thu, 3 Dec 2020 08:12:43 +0000 (09:12 +0100)
- removed no longer needed config entry
- used StorableSocket::SOCKET_PROTOCOL_TCP instead of direct 'tcp'
- improved some exception messages a bit

Signed-off-by: Roland Häder <roland@mxchange.org>
application/hub/classes/container/socket/class_SocketContainer.php
application/hub/classes/factories/socket/class_SocketFactory.php
application/hub/classes/handler/raw_data/tcp/class_TcpRawDataHandler.php
application/hub/config.php

index af36ce2d1a51f502e3692276d29367ef76143f85..b35386050a87db321f8a3458a0a7a84d6b390902 100644 (file)
@@ -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
index 91f83e676f2a40de424370756c4538613e560564..0180d652c39bdb181871cf7e6091cdd2770748e6 100644 (file)
@@ -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
index 773625ff724319ba451dbdf95295d1c2846a06e9..a979a0344941053ff429d96a5dc6594907852fc8 100644 (file)
@@ -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);
        }
 
        /**
index 56d70f508e10d3f44c7cba9eb2c3fd3f91587965..08245c48a4e03527479694e539d42120945ff77a 100644 (file)
@@ -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', '');