//* DEBUG-DIE: */ die(__METHOD__ . ':packageData=' . print_r($packageData, TRUE));
// Get all keys and check them
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: this->instanceRegistry()=%d', count($this->getInstanceRegistry())));
foreach ($this->getInstanceRegistry() as $key => $registryInstance) {
// This is always a SubRegistry instance
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: key=' . $key . ',registryInstance=' . $registryInstance->__toString());
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,registryInstance=%s', $key, $registryInstance->__toString()));
foreach ($registryInstance->getInstanceRegistry() as $subKey => $socketInstance) {
// Is this a StorableSocket instance and is the address the same?
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: key=' . $key . ',subKey=' . $subKey . ',socketInstance=' . $socketInstance->__toString());
- if (($socketInstance instanceof StorableSocket) && ($socketInstance->ifAddressMatches($packageInstance->getRecipientUnl()))) {
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s,socketInstance=%s', $key, $subKey, $socketInstance->__toString()));
+ if ($socketInstance->ifAddressMatches($packageInstance->getRecipientUnl())) {
// Get listener and helper instances
- //* NOSY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: Calling socketInstance->getListenerInstance() ...');
+ /* NOSY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s, calling socketInstance->getListenerInstance() ...', $key, $subKey));
//* DEBUG-DIE: */ die(__METHOD__ . ': socketInstance=' . print_r($socketInstance, TRUE));
$listenerInstance = $socketInstance->getListenerInstance();
$helperInstance = $socketInstance->getHelperInstance();
// Is a listener or helper set?
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: key=' . $key . ',subKey=' . $subKey . ',listenerInstance[]=' . gettype($listenerInstance) . ',helperInstance[]=' . gettype($helperInstance));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s,listenerInstance[]=%s,helperInstance[]=%s', $key, $subKey, gettype($listenerInstance), gettype($helperInstance)));
if ($listenerInstance instanceof Listenable) {
// Found a listener, so get the info instance first
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s: Getting infoInstance for listenerInstance->protocolName=%s ...', $key, $subKey, $listenerInstance->getProtocolName()));
$infoInstance = ConnectionInfoFactory::createConnectionInfoInstance($listenerInstance->getProtocolName(), 'helper');
// Fill info instance with listener data
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s: Calling infoInstance->fillWithListenerInformation(%s) ...', $key, $subKey, $listenerInstance->__toString()));
$infoInstance->fillWithListenerInformation($listenerInstance);
} elseif ($helperInstance instanceof ConnectionHelper) {
// Found a helper, so get the info instance first
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s: Getting infoInstance for helperInstance->protocolName=%s ...', $key, $subKey, $helperInstance->getProtocolName()));
$infoInstance = ConnectionInfoFactory::createConnectionInfoInstance($helperInstance->getProtocolName(), 'helper');
// Helper is found
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s: Calling infoInstance->fillWithHelperInformation(%s) ...', $key, $subKey, $helperInstance->__toString()));
$infoInstance->fillWithConnectionHelperInformation($helperInstance);
} else {
// Not supported state!
- $this->debugInstance(sprintf('[%s:%d]: Invalid script-state found, please report this to the developers with full debug infos. socketInstance=%s', __METHOD__, __LINE__, print_r($socketInstance, TRUE)));
+ $this->debugInstance(sprintf('[%s:%d]: Invalid script-state found, please report this to the developers with full debug infos. key=%s,subKey=%s,socketInstance=%s', __METHOD__, __LINE__, $key, $subKey, print_r($socketInstance, TRUE)));
}
// Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: key=' . $key . ',subKey=' . $subKey . ',infoInstance[' . gettype($infoInstance) . ']=' . $infoInstance->__toString() . ' with protocol ' . $infoInstance->getProtocolName() . ' - FOUND!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: key=%s,subKey=%s,infoInstance[%s]=%s with protocol %s - FOUND!', $key, $subKey, gettype($infoInstance), $infoInstance->__toString(), $infoInstance->getProtocolName()));
break;
}
}
// Is no longer NULL set?
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: infoInstance[]=%s', gettype($infoInstance)));
if (!is_null($infoInstance)) {
// Then skip here, too
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: BREAK!');
break;
}
}
// Return the info instance
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: infoInstance[]=' . gettype($infoInstance) . ' - EXIT!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: infoInstance[]=%s - EXIT!', gettype($infoInstance)));
return $infoInstance;
}