From 0666ba69bf42fb6fff9e7c15e79ff60b07044805 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 18 Aug 2021 17:10:21 +0200 Subject: [PATCH] Continued: - improved debug messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../handler/package/class_NetworkPackageHandler.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/application/hub/classes/handler/package/class_NetworkPackageHandler.php b/application/hub/classes/handler/package/class_NetworkPackageHandler.php index 7b7cfda87..39730da4f 100644 --- a/application/hub/classes/handler/package/class_NetworkPackageHandler.php +++ b/application/hub/classes/handler/package/class_NetworkPackageHandler.php @@ -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!'); } /** -- 2.39.5