+ // Debug message
+ /* NOISY-DEBUG: */ $this->debugOutput('SOCKET-REGISTRY: protocol=' . $protocolInstance->getProtocol() . ',socketResource[' . gettype($socketResource) . ']=' . $socketResource . ',key=' . $key . ',socketKey=' . $socketKey . ' - Checking existence ...');
+
+ // Is it there?
+ if ($registryInstance->instanceExists($socketKey)) {
+ // Debug message
+ /* NOISY-DEBUG: */ $this->debugOutput('SOCKET-REGISTRY: Found instance for socketKey=' . $socketKey . ':' . $registryInstance->getInstance($socketKey));
+
+ // Get the instance
+ $registeredInstance = $registryInstance->getInstance($socketKey);
+
+ // Is it SocketContainer and same socket?
+ $isRegistered = (($registeredInstance instanceof SocketContainer) && ($registeredInstance->ifSocketResourceMatches($socketResource)));
+
+ // Debug message
+ /* NOISY-DEBUG: */ $this->debugOutput('SOCKET-REGISTRY: Final result: isRegistered(' . $socketResource . ')=' . intval($isRegistered));
+ } // END - if