]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/class_BaseFrameworkSystem.php
Moved a lot back to hub:
[core.git] / framework / main / classes / class_BaseFrameworkSystem.php
index e9b7919dfbb56a857ce3da46b0683c8940dabdec..9262934f375aa10fc3c04c7d5473ec746a03f0d6 100644 (file)
@@ -25,8 +25,6 @@ use CoreFramework\Generic\NullPointerException;
 use CoreFramework\Generic\UnsupportedOperationException;
 use CoreFramework\Handler\Stream\IoHandler;
 use CoreFramework\Index\Indexable;
-use CoreFramework\Listener\BaseListener;
-use CoreFramework\Listener\Listenable;
 use CoreFramework\Lists\Listable;
 use CoreFramework\Loader\ClassLoader;
 use CoreFramework\Manager\ManageableApplication;
@@ -249,11 +247,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        private $directoryInstance = NULL;
 
-       /**
-        * Listener instance
-        */
-       private $listenerInstance = NULL;
-
        /**
         * An instance of a communicator
         */
@@ -1525,25 +1518,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                return $this->directoryInstance;
        }
 
-       /**
-        * Setter for listener instance
-        *
-        * @param       $listenerInstance       A Listenable instance
-        * @return      void
-        */
-       protected final function setListenerInstance (Listenable $listenerInstance) {
-               $this->listenerInstance = $listenerInstance;
-       }
-
-       /**
-        * Getter for listener instance
-        *
-        * @return      $listenerInstance       A Listenable instance
-        */
-       protected final function getListenerInstance () {
-               return $this->listenerInstance;
-       }
-
        /**
         * Getter for communicator instance
         *
@@ -3364,50 +3338,4 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                return $stateName;
        }
 
-       /**
-        * Handles socket error for given socket resource and peer data. This method
-        * validates $socketResource if it is a valid resource (see is_resource())
-        * but assumes valid data in array $recipientData, except that
-        * count($recipientData) is always 2.
-        *
-        * @param       $method                         Value of __METHOD__ from calling method
-        * @param       $line                           Value of __LINE__ from calling method
-        * @param       $socketResource         A valid socket resource
-        * @param       $socketData                     A valid socket data array (0 = IP/file name, 1 = port)
-        * @return      void
-        * @throws      InvalidSocketException  If $socketResource is no socket resource
-        * @throws      NoSocketErrorDetectedException  If socket_last_error() gives zero back
-        * @todo        Move all this socket-related stuff into own class, most of it resides in BaseListener
-        */
-       protected final function handleSocketError ($method, $line, $socketResource, array $socketData) {
-               // 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 socket array, 1st element is mostly IP address (or file name), 2nd is port number
-               //* DEBUG-DIE: */ die(__METHOD__ . ':socketData=' . print_r($socketData, true));
-               assert(isset($socketData[0]));
-               assert(isset($socketData[1]));
-
-               // Get error code for first validation (0 is not an error)
-               $errorCode = socket_last_error($socketResource);
-
-               // If the error code is zero, someone called this method without an error
-               if ($errorCode == 0) {
-                       // No error detected (or previously cleared outside this method)
-                       throw new NoSocketErrorDetectedException(array($this, $socketResource), BaseListener::EXCEPTION_NO_SOCKET_ERROR);
-               } // END - if
-
-               // Get handler (method) name
-               $handlerName = $this->getSocketErrorHandlerFromCode($errorCode);
-
-               // Call-back the error handler method
-               call_user_func_array(array($this, $handlerName), array($socketResource, $socketData));
-
-               // Finally clear the error because it has been handled
-               socket_clear_error($socketResource);
-       }
-
 }