$this->debugOutput('POOL: Socket resource is server socket (' . $socketResource . '). This is not a bug.');
}
- // Output error message
+ // Debug message
$this->debugOutput('POOL: Adding peer ' . $peerName . ',socketResource=' . $socketResource);
// Add it finally to the pool
foreach ($this->getInstanceRegistry() as $key => $registryInstance) {
// This is always a SubRegistry instance
foreach ($registryInstance->getInstanceRegistry() as $subKey => $containerInstance) {
+ // Debug message
+ /* NOISY-DEBUG: */ $this->debugOutput('CONNECTION-REGISTRY: key=' . $key . ',subKey=' . $subKey . ',containerInstance=' . $containerInstance->__toString());
+
// This is a ConnectionContainer instance, so does the recipient match?
if ($containerInstance->ifAddressMatches($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])) {
// Found one, so get the protocol instance and abort any further search
// 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;