]> git.mxchange.org Git - hub.git/commitdiff
Even more debug lines added, check for SocketContainer added
authorRoland Häder <roland@mxchange.org>
Sat, 19 May 2012 13:53:17 +0000 (13:53 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 19 May 2012 13:53:17 +0000 (13:53 +0000)
application/hub/main/pools/peer/class_DefaultPeerPool.php
application/hub/main/registry/connection/class_ConnectionRegistry.php
application/hub/main/registry/socket/class_SocketRegistry.php

index f80dfdb8edbad42f5736465e04f059379bfa6f79..67b02b89c5ae1a518a656e1b8aa5a9edfbe1ee1e 100644 (file)
@@ -116,7 +116,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer {
                        $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
index 22aaedf1e41069b99f1692362dd04b1cc3c349ae..95405b26fcb54d1f9b5e68f5258f7062a8d50634 100644 (file)
@@ -220,6 +220,9 @@ class ConnectionRegistry extends BaseRegistry implements Register, RegisterableC
                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
index f6e402559806f9e0cbf78a32eb05eea11be44306..921cc04e99fdc4be7eae210088ea72942929662f 100644 (file)
@@ -218,10 +218,16 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
 
                // 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;