]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 19 May 2017 22:36:50 +0000 (00:36 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 21 Aug 2020 16:50:04 +0000 (18:50 +0200)
- Let's log the error code, too!
- renamed method to getLastSocketError()

Signed-off-by: Roland Häder <roland@mxchange.org>
application/hub/classes/class_BaseHubSystem.php
application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php
application/hub/classes/factories/socket/class_SocketFactory.php
application/hub/classes/listener/class_BaseListener.php

index 5c2f329ed674d82d75f1a8881e4c7d6411fd439b..e81113d924dba95baefe6bcabd391fcd3cbde001 100644 (file)
@@ -144,7 +144,7 @@ class BaseHubSystem extends BaseFrameworkSystem implements HubInterface {
         */
        public final function handleSocketError ($method, $line, StorableSocket $socketInstance, array $socketData) {
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('HUB-SYSTEM: CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HUB-SYSTEM: Handling socket errorCode=%d - CALLED!', $socketInstance->getLastSocketError()));
 
                // This method handles only socket resources
                if (!$socketInstance->isValidSocket()) {
@@ -158,7 +158,7 @@ class BaseHubSystem extends BaseFrameworkSystem implements HubInterface {
                assert(isset($socketData[1]));
 
                // Get error code for first validation (0 is not an error)
-               $errorCode = $socketInstance->getSocketLastError();
+               $errorCode = $socketInstance->getLastSocketError();
 
                // If the error code is zero, someone called this method without an error
                if ($errorCode == 0) {
index ac471d66afe71bd2c1116eeca06b275c62b8793a..c08c97f1aee708323fc38560564a209b2c0ba432 100644 (file)
@@ -176,7 +176,7 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-DISCOVERY: socketInstance[]=%s', gettype($socketInstance)));
 
                // Is it FALSE, the recipient isn't known to us and we have no connection to it
-               if (($socketInstance instanceof StorableSocket) || (!$socketInstance->isValidSocket()) || ($socketInstance->getSocketLastError() > 0)) {
+               if (($socketInstance instanceof StorableSocket) || (!$socketInstance->isValidSocket()) || ($socketInstance->getLastSocketError() > 0)) {
                        // Try to create a new socket resource
                        try {
                                // Possibly noisy debug message
index 718e6b1aca84255a3a5c7a9995400549aad38bdb..297342a5b038bf604260cbaadec3b2988ed7f9d0 100644 (file)
@@ -141,7 +141,7 @@ class SocketFactory extends ObjectFactory {
                } // END - if
 
                // Get socket error code for verification
-               $socketError = $socketInstance->getSocketLastError();
+               $socketError = $socketInstance->getLastSocketError();
 
                // Check if there was an error else
                if ($socketError > 0) {
index 89db507eddb843d9f7170164407496834e17cb6b..fa72d314e8db0a25253f5aba9d6bbe4c6b6ef2fc 100644 (file)
@@ -525,10 +525,10 @@ class BaseListener extends BaseHubSystem implements Visitable {
         */
        protected function socketErrorPermissionDeniedHandler (StorableSocket $socketInstance, array $socketData) {
                // Get socket error code for verification
-               $socketError = $socketInstance->getSocketLastError();
+               $socketError = $socketInstance->getLastSocketError();
 
                // Get error message
-               $errorMessage = $socketInstance->getSocketLastErrorMessage();
+               $errorMessage = $socketInstance->getLastSocketErrorMessage();
 
                // Shutdown this socket
                $socketInstance->shutdownSocket();