]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/pools/peer/class_DefaultPeerPool.php
Introduced self::createDebugInstance()
[hub.git] / application / hub / main / pools / peer / class_DefaultPeerPool.php
index 7e4efe535d74b892900a628382d70e14cb095c4a..57fd5bd17a97e7edec62cda5623ec4bbab21a0f5 100644 (file)
@@ -94,7 +94,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer {
         */
        public function addPeer ($socketResource, $connectionType) {
                // Debug message
-               //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ': socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',connectionType=' . $connectionType . ' - ENTERED!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ': socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',connectionType=' . $connectionType . ' - ENTERED!');
 
                // Validate the socket
                $this->validateSocket($socketResource);
@@ -124,11 +124,11 @@ class DefaultPeerPool extends BasePool implements PoolablePeer {
                        } // END - if
                } else {
                        // Server sockets won't work with socket_getpeername()
-                       $this->debugOutput('POOL: Socket resource is server socket (' . $socketResource . '). This is not a bug.');
+                       self::createDebugInstance(__CLASS__)->debugOutput('POOL: Socket resource is server socket (' . $socketResource . '). This is not a bug.');
                }
 
                // Debug message
-               $this->debugOutput('POOL: Adding peer ' . $peerName . ',socketResource=' . $socketResource . ',type=' . $connectionType);
+               self::createDebugInstance(__CLASS__)->debugOutput('POOL: Adding peer ' . $peerName . ',socketResource=' . $socketResource . ',type=' . $connectionType);
 
                // Construct the array
                $socketArray = array(
@@ -227,7 +227,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer {
                assert(count($recipientIpArray) == 2);
 
                // Debug message
-               /* NOISY-DEBUG: */ $this->debugOutput('POOL: Checking ' . count($this->getAllSockets()) . ' socket(s),recipientIpArray[0]=' . $recipientIpArray[0] . ',recipientIpArray[1]=' . $recipientIpArray[1] . ' ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL: Checking ' . count($this->getAllSockets()) . ' socket(s),recipientIpArray[0]=' . $recipientIpArray[0] . ',recipientIpArray[1]=' . $recipientIpArray[1] . ' ...');
 
                // Default is all sockets
                $sockets = $this->getAllSockets();
@@ -246,7 +246,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer {
                        // Is this a server socket?
                        if ($socketArray[self::SOCKET_ARRAY_RESOURCE] === $this->getListenerInstance()->getSocketResource()) {
                                // Skip 'server' sockets (local socket)
-                               /* NOISY-DEBUG: */ $this->debugOutput('POOL: Skipping server socket ' . $socketArray[self::SOCKET_ARRAY_RESOURCE] . ' ...');
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL: Skipping server socket ' . $socketArray[self::SOCKET_ARRAY_RESOURCE] . ' ...');
                                continue;
                        } // END - if
 
@@ -263,13 +263,13 @@ class DefaultPeerPool extends BasePool implements PoolablePeer {
                                $socketResource = $socketArray[self::SOCKET_ARRAY_RESOURCE];
 
                                // Debug message
-                               /* NOISY-DEBUG: */ $this->debugOutput('POOL: peerIp=' . $peerIp . ' matches with recipient IP address. Taking socket=' . $socketArray[self::SOCKET_ARRAY_RESOURCE] . ',type=' . $socketArray[self::SOCKET_ARRAY_CONN_TYPE]);
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL: peerIp=' . $peerIp . ' matches with recipient IP address. Taking socket=' . $socketArray[self::SOCKET_ARRAY_RESOURCE] . ',type=' . $socketArray[self::SOCKET_ARRAY_CONN_TYPE]);
                                break;
                        } // END - if
                } // END - foreach
 
                // Return the determined socket resource
-               /* NOISY-DEBUG: */ $this->debugOutput('POOL: socketResource[' . gettype($socketResource) . ']=' . $socketResource);
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('POOL: socketResource[' . gettype($socketResource) . ']=' . $socketResource);
                return $socketResource;
        }
 }