// Get all keys and check them
foreach ($this->getInstanceRegistry() as $key => $registryInstance) {
+ // Debug message
+ /* NOISY-DEBUG: */ $this->debugOutput('SOCKET-REGISTRY: key=' . $key . ',registryInstance=' . $registryInstance->__toString());
+
// This is always a SubRegistry instance
foreach ($registryInstance->getInstanceRegistry() as $subKey => $containerInstance) {
- // This is a SocketContainer instance, so does the recipient match?
- if ($containerInstance->ifAddressMatches($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])) {
+ // Debug message
+ /* NOISY-DEBUG: */ $this->debugOutput('SOCKET-REGISTRY: key=' . $key . ',subKey=' . $subKey . ',containerInstance=' . $containerInstance->__toString());
+
+ // Is this a SocketContainer instance and is the address the same?
+ if (($containerInstance instanceof SocketContainer) && ($containerInstance->ifAddressMatches($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]))) {
// Found one, so get the protocol instance and abort any further search
$protocolInstance = $containerInstance->getProtocolInstance();
break;