// That one is found so "get" a registry key from it
$key = $this->getRegistryKeyFromInfo($infoInstance);
- // Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: protocolName=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketInstance->getSocketResource()) . ']=' . $socketInstance->getSocketResource() . ',key=' . $key . ' - Trying to get instance ...');
-
// Get the registry
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: protocolName=' . $infoInstance->getProtocolName() . ',socketResource[' . gettype($socketInstance->getSocketResource()) . ']=' . $socketInstance->getSocketResource() . ',key=' . $key . ' - Trying to get instance ...');
$registryInstance = $this->getInstance($key);
// "Get" a key for the socket
foreach ($registryInstance->getInstanceRegistry() as $subKey => $socketInstance) {
// Is this a StorableSocket instance and is the address the same?
/* 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())) {
+ if (($socketInstance instanceof StorableSocket) && ($socketInstance->ifAddressMatches($packageInstance->getRecipientUnl()))) {
// Get listener and helper instances
/* 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));