]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/registry/socket/class_SocketRegistry.php
Added line numbers to debug lines as this will become the 'norm'
[hub.git] / application / hub / main / registry / socket / class_SocketRegistry.php
index 332f7b0cbbf67f1d00bd5d4be2bafe295178a9b1..e9498c579b0b3aa5456167da367c43ed7286bc8d 100644 (file)
@@ -150,7 +150,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
                        $key = $this->getRegistryKeyFromProtocol($protocolInstance);
 
                        // Debug message
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY: protocol=' . $protocolInstance->getProtocol() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ' - Trying to get instance ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __LINE__ . ']: protocol=' . $protocolInstance->getProtocol() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ' - Trying to get instance ...');
 
                        // Get the registry
                        $registryInstance = $this->getInstance($key);
@@ -159,12 +159,12 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
                        $socketKey = $this->getSubRegistryKey($protocolInstance);
 
                        // Debug message
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY: protocol=' . $protocolInstance->getProtocol() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ',socketKey=' . $socketKey . ' - Checking existence ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __LINE__ . ']: protocol=' . $protocolInstance->getProtocol() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ',socketKey=' . $socketKey . ' - Checking existence ...');
 
                        // Is it there?
                        if ($registryInstance->instanceExists($socketKey)) {
                                // Debug message
-                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY: Found instance for socketKey=' . $socketKey . ':' . $registryInstance->getInstance($socketKey));
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __LINE__ . ']: Found instance for socketKey=' . $socketKey . ':' . $registryInstance->getInstance($socketKey));
 
                                // Get the instance
                                $registeredInstance = $registryInstance->getInstance($socketKey);
@@ -173,7 +173,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
                                $isRegistered = (($registeredInstance instanceof SocketContainer) && ($registeredInstance->ifSocketResourceMatches($socketResource)));
 
                                // Debug message
-                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY: Final result: isRegistered(' . $socketResource . ')=' . intval($isRegistered));
+                               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __LINE__ . ']: Final result: isRegistered(' . $socketResource . ')=' . intval($isRegistered));
                        } // END - if
                } // END - if
 
@@ -206,7 +206,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
                // Does the instance exist?
                if (!$this->isProtocolRegistered($protocolInstance)) {
                        // No, not found so we create a sub registry (not needed to configure!)
-                       $registryInstance = SubRegistry::createSubRegistry();
+                       $registryInstance = SubREGISTRY[' . __LINE__ . ']::createSubRegistry();
 
                        // Now we can create the sub-registry for this protocol
                        $this->addInstance($this->getRegistryKeyFromProtocol($protocolInstance), $registryInstance);
@@ -222,7 +222,7 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
                $socketInstance = ObjectFactory::CreateObjectByConfiguredName('socket_container_class', array($socketResource, $protocolInstance, $packageData));
 
                // We have a sub-registry, the socket key and the socket, now we need to put all together
-               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY: socketKey=' . $socketKey . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - adding socket container instance ...');
+               /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __LINE__ . ']: socketKey=' . $socketKey . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ' - adding socket container instance ...');
                $registryInstance->addInstance($socketKey, $socketInstance);
        }
 
@@ -275,12 +275,12 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke
                // Get all keys and check them
                foreach ($this->getInstanceRegistry() as $key => $registryInstance) {
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY: key=' . $key . ',registryInstance=' . $registryInstance->__toString());
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __LINE__ . ']: key=' . $key . ',registryInstance=' . $registryInstance->__toString());
 
                        // This is always a SubRegistry instance
                        foreach ($registryInstance->getInstanceRegistry() as $subKey => $containerInstance) {
                                // Debug message
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY: key=' . $key . ',subKey=' . $subKey . ',containerInstance=' . $containerInstance->__toString());
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-REGISTRY[' . __LINE__ . ']: 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]))) {