$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
$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!');
}
/**