]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/class_BaseHubSystem.php
Continued rewrite:
[hub.git] / application / hub / main / class_BaseHubSystem.php
index 0426bd28a33b75e6b129d93db9dda0595dce27eb..bba43c512828b86e58da05b6ec9c518aed6df281 100644 (file)
@@ -480,20 +480,23 @@ class BaseHubSystem extends BaseFrameworkSystem {
         * @param       $method                         Value of __METHOD__ from calling method
         * @param       $line                           Value of __LINE__ from calling method
         * @param       $socketResource         A valid socket resource
-        * @param       $recipientData          An array with two elements: 0=IP number, 1=port number
+        * @param       $unlData                        A valid UNL data array
         * @return      void
         * @throws      InvalidSocketException  If $socketResource is no socket resource
         * @throws      NoSocketErrorDetectedException  If socket_last_error() gives zero back
         */
-       protected final function handleSocketError ($method, $line, $socketResource, array $recipientData) {
+       protected final function handleSocketError ($method, $line, $socketResource, array $unlData) {
                // This method handles only socket resources
                if (!is_resource($socketResource)) {
                        // No resource, abort here
                        throw new InvalidSocketException(array($this, $socketResource), BaseListener::EXCEPTION_INVALID_SOCKET);
                } // END - if
 
-               // Check count of array, should be two
-               assert(count($recipientData) == 2);
+               // Check UNL array
+               //* DEBUG-DIE: */ die(__METHOD__ . ':unlData=' . print_r($unlData, TRUE));
+               assert(isset($unlData[UniversalNodeLocator::UNL_PART_PROTOCOL]));
+               assert(isset($unlData[UniversalNodeLocator::UNL_PART_ADDRESS]));
+               assert(isset($unlData[UniversalNodeLocator::UNL_PART_PORT]));
 
                // Get error code for first validation (0 is not an error)
                $errorCode = socket_last_error($socketResource);
@@ -508,7 +511,7 @@ class BaseHubSystem extends BaseFrameworkSystem {
                $handlerName = $this->getSocketErrorHandlerFromCode($errorCode);
 
                // Call-back the error handler method
-               call_user_func_array(array($this, $handlerName), array($socketResource, $recipientData));
+               call_user_func_array(array($this, $handlerName), array($socketResource, $unlData));
 
                // Finally clear the error because it has been handled
                socket_clear_error($socketResource);