]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 18 Aug 2021 15:10:21 +0000 (17:10 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 18 Aug 2021 15:10:21 +0000 (17:10 +0200)
- improved debug messages

Signed-off-by: Roland Häder <roland@mxchange.org>
application/hub/classes/handler/package/class_NetworkPackageHandler.php

index 7b7cfda876b60124daafe9b69e575e95650a3829..39730da4f92c909bf941327417a7e59eb95e8688 100644 (file)
@@ -670,7 +670,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $socketInstance = $discoveryInstance->discoverSocket($packageInstance, StorableSocket::CONNECTION_TYPE_OUTGOING);
 
                // Get the connection helper from registry
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Reached line ' . __LINE__ . ' after discoverSocket() has been called.');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Getting helperInstance for connection from registry ...');
                $helperInstance = GenericRegistry::getRegistry()->getInstance('connection');
 
                // Get connection info class
@@ -678,32 +678,33 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei
                $infoInstance = ConnectionInfoFactory::createConnectionInfoInstance($helperInstance->getProtocolName(), 'helper');
 
                // Will the info instance with connection helper data
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Calling infoInstance->fillWithConnectionHelperInformation(%s) ...', $helperInstance->__toString()));
                $infoInstance->fillWithConnectionHelperInformation($helperInstance);
 
                // Is it not there?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Reached line ' . __LINE__ . ' before isSocketRegistered() has been called.');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: socketInstance->isValidSocket()=%d', intval($socketInstance->isValidSocket())));
                if (($socketInstance->isValidSocket()) && (!$this->getRegistryInstance()->isSocketRegistered($infoInstance, $socketInstance))) {
                        // Then register it
                        /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Registering socket %s ...', $socketInstance));
                        $this->getRegistryInstance()->registerSocketInstance($infoInstance, $socketInstance);
                } elseif (!$helperInstance->getStateInstance()->isPeerStateConnected()) {
                        // Is not connected, then we cannot send
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Unexpected peer state ' . $helperInstance->getStateInstance()->__toString() . ' detected.');
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Unexpected peer state %s detected.', $helperInstance->getStateInstance()->__toString()));
 
                        // Shutdown the socket
                        $socketInstance->shutdownSocket();
                }
 
                // Make sure the connection is up
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Reached line ' . __LINE__ . ' after isSocketRegistered() has been called.');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Calling helperInstance->stateInstance->validatePeerStateConnected() ...');
                $helperInstance->getStateInstance()->validatePeerStateConnected();
 
                // Enqueue it again on the out-going queue, the connection is up and working at this point
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Reached line ' . __LINE__ . ' after validatePeerStateConnected() has been called.');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Calling this->stackInstance->pushNamed(%s, %s) ...', self::STACKER_NAME_OUTGOING, $packageInstance->__toString()));
                $this->getStackInstance()->pushNamed(self::STACKER_NAME_OUTGOING, $packageInstance);
 
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Reached line ' . __LINE__ . ' after pushNamed() has been called.');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
        }
 
        /**