From f3f6e7d3770a679742105bf1ae47d690204a34b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 20 May 2017 22:28:46 +0200 Subject: [PATCH] Continued: - Per definition, filters are classes. So let's add _class into their configuration keys to have the later testing suite easily pick them up for testing. - implemented enableSocketNonBlocking() - imported InvalidServerSocketException - let's get peerAddress (old: peerName) and peerPort via call-by-reference and as all the other socket methods result as returned value - always initialize variables, before using them ... MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../class_HubConsoleAptProxyCommand.php | 16 +-- .../console/class_HubConsoleChatCommand.php | 16 +-- .../class_HubConsoleCrawlerCommand.php | 16 +-- .../class_HubConsoleCruncherCommand.php | 18 +-- .../console/class_HubConsoleMainCommand.php | 24 ++-- .../console/class_HubConsoleMinerCommand.php | 18 +-- .../html/class_HubHtmlIndexCommand.php | 2 +- .../socket/class_SocketContainer.php | 31 ++++- .../class_HubConsoleDefaultNewsController.php | 4 +- .../class_PeerStateLookupDatabaseWrapper.php | 12 +- .../chain/class_PackageFilterChainFactory.php | 2 +- .../classes/listener/class_BaseListener.php | 9 +- .../classes/nodes/list/class_HubListNode.php | 2 +- .../nodes/master/class_HubMasterNode.php | 2 +- .../nodes/regular/class_HubRegularNode.php | 2 +- .../pools/peer/class_DefaultPeerPool.php | 17 ++- application/hub/config.php | 118 +++++++++--------- .../container/socket/class_StorableSocket.php | 8 ++ 18 files changed, 183 insertions(+), 134 deletions(-) diff --git a/application/hub/classes/commands/console/class_HubConsoleAptProxyCommand.php b/application/hub/classes/commands/console/class_HubConsoleAptProxyCommand.php index dc3bff6bf..0d4f253d2 100644 --- a/application/hub/classes/commands/console/class_HubConsoleAptProxyCommand.php +++ b/application/hub/classes/commands/console/class_HubConsoleAptProxyCommand.php @@ -121,22 +121,22 @@ class HubConsoleAptProxyCommand extends BaseCommand implements Commandable { */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Add pre filters - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_php_requirements_filter')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_initializer_filter')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_welcome_teaser_filter')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_php_requirements_filter_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_initializer_filter_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_welcome_teaser_filter_class')); // Add bootstrap filters - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_bootstrap_task_handler_initializer_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_bootstrap_extra_bootstrapping_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_bootstrap_task_handler_initializer_filter_class')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_bootstrap_extra_bootstrapping_filter_class')); // This is the last generic boostrap filter - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_bootstrap_generic_activation_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_bootstrap_generic_activation_filter_class')); // Add shutdown filters - //$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_shutdown_task_handler_filter')); + //$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_shutdown_task_handler_filter_class')); // This is the last generic shutdown filter - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_shutdown_filter')); + $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_shutdown_filter_class')); } } diff --git a/application/hub/classes/commands/console/class_HubConsoleChatCommand.php b/application/hub/classes/commands/console/class_HubConsoleChatCommand.php index 95ceaef8b..7b1ec9134 100644 --- a/application/hub/classes/commands/console/class_HubConsoleChatCommand.php +++ b/application/hub/classes/commands/console/class_HubConsoleChatCommand.php @@ -121,22 +121,22 @@ class HubConsoleChatCommand extends BaseCommand implements Commandable { */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Add pre filters - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('chat_php_requirements_filter')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('chat_initializer_filter')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('chat_welcome_teaser_filter')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('chat_php_requirements_filter_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('chat_initializer_filter_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('chat_welcome_teaser_filter_class')); // Add bootstrap filters - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('chat_bootstrap_task_handler_initializer_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('chat_bootstrap_extra_bootstrapping_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('chat_bootstrap_task_handler_initializer_filter_class')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('chat_bootstrap_extra_bootstrapping_filter_class')); // This is the last generic boostrap filter - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('chat_bootstrap_generic_activation_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('chat_bootstrap_generic_activation_filter_class')); // Add shutdown filters - //$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('chat_shutdown_task_handler_filter')); + //$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('chat_shutdown_task_handler_filter_class')); // This is the last generic shutdown filter - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('chat_shutdown_filter')); + $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('chat_shutdown_filter_class')); } } diff --git a/application/hub/classes/commands/console/class_HubConsoleCrawlerCommand.php b/application/hub/classes/commands/console/class_HubConsoleCrawlerCommand.php index 0562334dc..f58a1279f 100644 --- a/application/hub/classes/commands/console/class_HubConsoleCrawlerCommand.php +++ b/application/hub/classes/commands/console/class_HubConsoleCrawlerCommand.php @@ -121,22 +121,22 @@ class HubConsoleCrawlerCommand extends BaseCommand implements Commandable { */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Add pre filters - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('crawler_php_requirements_filter')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('crawler_initializer_filter')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('crawler_welcome_teaser_filter')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('crawler_php_requirements_filter_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('crawler_initializer_filter_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('crawler_welcome_teaser_filter_class')); // Add bootstrap filters - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('crawler_bootstrap_task_handler_initializer_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('crawler_bootstrap_extra_bootstrapping_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('crawler_bootstrap_task_handler_initializer_filter_class')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('crawler_bootstrap_extra_bootstrapping_filter_class')); // This is the last generic boostrap filter - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('crawler_bootstrap_generic_activation_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('crawler_bootstrap_generic_activation_filter_class')); // Add shutdown filters - //$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('crawler_shutdown_task_handler_filter')); + //$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('crawler_shutdown_task_handler_filter_class')); // This is the last generic shutdown filter - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('crawler_shutdown_filter')); + $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('crawler_shutdown_filter_class')); } } diff --git a/application/hub/classes/commands/console/class_HubConsoleCruncherCommand.php b/application/hub/classes/commands/console/class_HubConsoleCruncherCommand.php index a0c8c4315..81f87a17c 100644 --- a/application/hub/classes/commands/console/class_HubConsoleCruncherCommand.php +++ b/application/hub/classes/commands/console/class_HubConsoleCruncherCommand.php @@ -121,23 +121,23 @@ class HubConsoleCruncherCommand extends BaseCommand implements Commandable { */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Add pre filters - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('cruncher_php_requirements_filter')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('cruncher_initializer_filter')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('cruncher_welcome_teaser_filter')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('cruncher_php_requirements_filter_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('cruncher_initializer_filter_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('cruncher_welcome_teaser_filter_class')); // Add bootstrap filters - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('cruncher_bootstrap_task_handler_initializer_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('cruncher_bootstrap_extra_bootstrapping_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('cruncher_bootstrap_buffer_queue_initializer_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('cruncher_bootstrap_task_handler_initializer_filter_class')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('cruncher_bootstrap_extra_bootstrapping_filter_class')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('cruncher_bootstrap_buffer_queue_initializer_filter_class')); // This is the last generic boostrap filter - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('cruncher_bootstrap_generic_activation_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('cruncher_bootstrap_generic_activation_filter_class')); // Add shutdown filters - //$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('cruncher_shutdown_task_handler_filter')); + //$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('cruncher_shutdown_task_handler_filter_class')); // This is the last generic shutdown filter - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('cruncher_shutdown_filter')); + $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('cruncher_shutdown_filter_class')); } } diff --git a/application/hub/classes/commands/console/class_HubConsoleMainCommand.php b/application/hub/classes/commands/console/class_HubConsoleMainCommand.php index 4044f51aa..14a4b5660 100644 --- a/application/hub/classes/commands/console/class_HubConsoleMainCommand.php +++ b/application/hub/classes/commands/console/class_HubConsoleMainCommand.php @@ -131,26 +131,26 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable { */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Add pre filters - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('node_php_requirements_filter')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('node_initializer_filter')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('node_welcome_teaser_filter')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('node_php_requirements_filter_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('node_initializer_filter_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('node_welcome_teaser_filter_class')); // Add bootstrap filters - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_generate_nodeid_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_generate_sessionid_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_generate_private_key_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_extra_bootstrapping_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_listener_pool_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_generate_nodeid_filter_class')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_generate_sessionid_filter_class')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_generate_private_key_filter_class')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_extra_bootstrapping_filter_class')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('node_bootstrap_listener_pool_filter_class')); // Add node activation filters - $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('node_activation_task_handler_initializer_filter')); + $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('node_activation_task_handler_initializer_filter_class')); // Add shutdown filters - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_flush_node_list_filter')); - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_task_handler_filter')); + $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_flush_node_list_filter_class')); + $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_task_handler_filter_class')); // This is the last generic shutdown filter - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_node_filter')); + $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_node_filter_class')); } } diff --git a/application/hub/classes/commands/console/class_HubConsoleMinerCommand.php b/application/hub/classes/commands/console/class_HubConsoleMinerCommand.php index 588f11047..c13874bde 100644 --- a/application/hub/classes/commands/console/class_HubConsoleMinerCommand.php +++ b/application/hub/classes/commands/console/class_HubConsoleMinerCommand.php @@ -121,23 +121,23 @@ class HubConsoleMinerCommand extends BaseCommand implements Commandable { */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Add pre filters - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('miner_php_requirements_filter')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('miner_initializer_filter')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('miner_welcome_teaser_filter')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('miner_php_requirements_filter_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('miner_initializer_filter_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('miner_welcome_teaser_filter_class')); // Add bootstrap filters - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('miner_bootstrap_task_handler_initializer_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('miner_bootstrap_extra_bootstrapping_filter')); - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('miner_bootstrap_buffer_queue_initializer_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('miner_bootstrap_task_handler_initializer_filter_class')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('miner_bootstrap_extra_bootstrapping_filter_class')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('miner_bootstrap_buffer_queue_initializer_filter_class')); // This is the last generic boostrap filter - $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('miner_bootstrap_generic_activation_filter')); + $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('miner_bootstrap_generic_activation_filter_class')); // Add shutdown filters - //$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('miner_shutdown_task_handler_filter')); + //$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('miner_shutdown_task_handler_filter_class')); // This is the last generic shutdown filter - $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('miner_shutdown_filter')); + $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('miner_shutdown_filter_class')); } } diff --git a/application/hub/classes/commands/html/class_HubHtmlIndexCommand.php b/application/hub/classes/commands/html/class_HubHtmlIndexCommand.php index 95f04f901..ff8d48379 100644 --- a/application/hub/classes/commands/html/class_HubHtmlIndexCommand.php +++ b/application/hub/classes/commands/html/class_HubHtmlIndexCommand.php @@ -95,7 +95,7 @@ class HubHtmlIndexCommand extends BaseCommand implements Commandable { */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Add pre filters - //$controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('node_php_requirements_filter')); + //$controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('node_php_requirements_filter_class')); } } diff --git a/application/hub/classes/container/socket/class_SocketContainer.php b/application/hub/classes/container/socket/class_SocketContainer.php index c62462bec..a49a2c809 100644 --- a/application/hub/classes/container/socket/class_SocketContainer.php +++ b/application/hub/classes/container/socket/class_SocketContainer.php @@ -149,8 +149,12 @@ class SocketContainer extends BaseContainer implements StorableSocket, Visitable // Trace message /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET: Testing if server socket - CALLED!'); + // Init peer address/port + $peerAddress = '0.0.0.0'; + $peerPort = '0'; + // Check it - $isServerSocket = (($this->isValidSocket()) && ($this->getSocketPeerName() === FALSE)); + $isServerSocket = (($this->isValidSocket()) && ($this->getSocketPeerName($peerAddress, $peerPort) === FALSE)); // Need to clear the error here if it is a resource if ($isServerSocket === true) { @@ -159,8 +163,11 @@ class SocketContainer extends BaseContainer implements StorableSocket, Visitable $this->clearLastSocketError(); } // END - if + // Debug message + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET: peerAddress=%s,peerPort=%d', $peerAddress, $peerPort)); + // Check peer name, it must be empty - $isServerSocket = (($isServerSocket) && (empty($peerName))); + $isServerSocket = (($isServerSocket) && (empty($peerAddress))); // Trace message /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET: isServerSocket=%d - EXIT!', intval($isServerSocket))); @@ -308,6 +315,26 @@ class SocketContainer extends BaseContainer implements StorableSocket, Visitable return $result; } + /** + * Tries to set non-blocking I/O on stored socket + * + * @return $result Result of changing to non-blocking I/O + * @throws InvalidSocketException If socket is valid + */ + public function enableSocketNonBlocking () { + // Should be valid socket + if (!$this->isValidSocket()) { + // Throw exception + throw new InvalidSocketException(array($this, $this->getSocketResource()), BaseListener::EXCEPTION_INVALID_SOCKET); + } // END - if + + // Try to set non-blocking I/O + $result = socket_set_nonblock($this->getSocketResource()); + + // Return result + return $result; + } + /** * Handles socket error for given socket resource and peer data. This method * validates socket resource stored in given container if it is a valid diff --git a/application/hub/classes/controller/console/class_HubConsoleDefaultNewsController.php b/application/hub/classes/controller/console/class_HubConsoleDefaultNewsController.php index 2ab7ed7ed..bf0a624e4 100644 --- a/application/hub/classes/controller/console/class_HubConsoleDefaultNewsController.php +++ b/application/hub/classes/controller/console/class_HubConsoleDefaultNewsController.php @@ -63,8 +63,8 @@ class HubConsoleDefaultNewsController extends BaseController implements Controll $controllerInstance->setResolverInstance($resolverInstance); // Add news filters to this controller - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter')); - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter_class')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter_class')); // Return the prepared instance return $controllerInstance; diff --git a/application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php b/application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php index 1e0e7784a..43be54620 100644 --- a/application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php +++ b/application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php @@ -157,8 +157,12 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper implements Look // Add session id $dataSetInstance->addCriteria(self::DB_COLUMN_PEER_SESSION_ID, $packageData[NetworkPackage::PACKAGE_DATA_SENDER]); + // Init peer address/port + $peerAddress = '0.0.0.0'; + $peerPort = '0'; + // Get peer name - if (!@socket_getpeername($socketResource, $peerName, $peerPort)) { + if (!@socket_getpeername($socketResource, $peerAddress, $peerPort)) { // Get last error $lastError = socket_last_error($socketResource); @@ -168,7 +172,7 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper implements Look } // END - if // Add ip address and port - $dataSetInstance->addCriteria(self::DB_COLUMN_PEER_IP , $peerName); + $dataSetInstance->addCriteria(self::DB_COLUMN_PEER_IP , $peerAddress); $dataSetInstance->addCriteria(self::DB_COLUMN_PEER_PORT, $peerPort); // "Insert" the data set @@ -231,7 +235,7 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper implements Look */ public function purgeOldEntriesBySocketResource ($socketResource) { // Get peer name - if (!@socket_getpeername($socketResource, $peerName, $peerPort)) { + if (!@socket_getpeername($socketResource, $peerAddress, $peerPort)) { // Get last error $lastError = socket_last_error($socketResource); @@ -240,7 +244,7 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper implements Look } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE-WRAPPER: peerName=' . $peerName . ',peerPort=' . $peerPort . ' - UNFINISHED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE-WRAPPER: peerAddress=' . $peerAddress . ',peerPort=' . $peerPort . ' - UNFINISHED!'); } /** diff --git a/application/hub/classes/factories/chain/class_PackageFilterChainFactory.php b/application/hub/classes/factories/chain/class_PackageFilterChainFactory.php index 72f7aa7fb..989d38b21 100644 --- a/application/hub/classes/factories/chain/class_PackageFilterChainFactory.php +++ b/application/hub/classes/factories/chain/class_PackageFilterChainFactory.php @@ -65,7 +65,7 @@ class PackageFilterChainFactory extends ObjectFactory { * simply means the tag is not valid. This however should be * handled some calls before this method is called. */ - $filterInstance = self::createObjectByConfiguredName('package_tag_' . $tag . '_filter'); + $filterInstance = self::createObjectByConfiguredName('package_tag_' . $tag . '_filter_class'); // Add this filter to the chain $chainInstance->addFilter($filterInstance); diff --git a/application/hub/classes/listener/class_BaseListener.php b/application/hub/classes/listener/class_BaseListener.php index fa72d314e..b1039c8d4 100644 --- a/application/hub/classes/listener/class_BaseListener.php +++ b/application/hub/classes/listener/class_BaseListener.php @@ -15,6 +15,7 @@ use Hub\Pool\Peer\PoolablePeer; use CoreFramework\Factory\ObjectFactory; use CoreFramework\Factory\Registry\Socket\SocketRegistryFactory; use CoreFramework\Generic\UnsupportedOperationException; +use CoreFramework\Socket\InvalidServerSocketException; use CoreFramework\Visitor\Visitable; use CoreFramework\Visitor\Visitor; @@ -461,8 +462,12 @@ class BaseListener extends BaseHubSystem implements Visitable { // Add it to the peers $this->getPoolInstance()->addPeer($newSocket, BaseConnectionHelper::CONNECTION_TYPE_INCOMING); + // Init peer address/port + $peerAddress = '0.0.0.0'; + $peerPort = '0'; + // Get peer name - if (!socket_getpeername($newSocket, $peerName)) { + if (!socket_getpeername($newSocket, $peerAddress)) { // Handle this socket error with a faked recipientData array $this->handleSocketError(__METHOD__, __LINE__, $newSocket, array('0.0.0.0', '0')); } // END - if @@ -472,7 +477,7 @@ class BaseListener extends BaseHubSystem implements Visitable { // Create a faked package data array $packageData = array( - NetworkPackage::PACKAGE_DATA_SENDER => $peerName . $peerSuffix, + NetworkPackage::PACKAGE_DATA_SENDER => $peerAddress . $peerSuffix, NetworkPackage::PACKAGE_DATA_RECIPIENT => $nodeInstance->getSessionId(), NetworkPackage::PACKAGE_DATA_STATUS => NetworkPackage::PACKAGE_STATUS_FAKED ); diff --git a/application/hub/classes/nodes/list/class_HubListNode.php b/application/hub/classes/nodes/list/class_HubListNode.php index a2e943fa7..e7d0587b9 100644 --- a/application/hub/classes/nodes/list/class_HubListNode.php +++ b/application/hub/classes/nodes/list/class_HubListNode.php @@ -84,7 +84,7 @@ class HubListNode extends BaseHubNode implements NodeHelper, Registerable { $controllerInstance = $applicationInstance->getControllerInstance(); // Self-announcement task - $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('node_activation_announcement_task_filter')); + $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('node_activation_announcement_task_filter_class')); // @TODO Add some filters here $this->partialStub('Add some filters here.'); diff --git a/application/hub/classes/nodes/master/class_HubMasterNode.php b/application/hub/classes/nodes/master/class_HubMasterNode.php index e2f8a2790..9909f36b8 100644 --- a/application/hub/classes/nodes/master/class_HubMasterNode.php +++ b/application/hub/classes/nodes/master/class_HubMasterNode.php @@ -87,7 +87,7 @@ class HubMasterNode extends BaseHubNode implements NodeHelper, Registerable { $controllerInstance = $applicationInstance->getControllerInstance(); // Self-announcement task - $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('node_activation_announcement_task_filter')); + $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('node_activation_announcement_task_filter_class')); // @TODO Add some filters here $this->partialStub('Add some filters here.'); diff --git a/application/hub/classes/nodes/regular/class_HubRegularNode.php b/application/hub/classes/nodes/regular/class_HubRegularNode.php index 085493ec1..1b80ee5c9 100644 --- a/application/hub/classes/nodes/regular/class_HubRegularNode.php +++ b/application/hub/classes/nodes/regular/class_HubRegularNode.php @@ -84,7 +84,7 @@ class HubRegularNode extends BaseHubNode implements NodeHelper, Registerable { $controllerInstance = $applicationInstance->getControllerInstance(); // Self-announcement task - $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('node_activation_announcement_task_filter')); + $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('node_activation_announcement_task_filter_class')); // @TODO Add some filters here $this->partialStub('Add some filters here.'); diff --git a/application/hub/classes/pools/peer/class_DefaultPeerPool.php b/application/hub/classes/pools/peer/class_DefaultPeerPool.php index 2e2d3db0e..a6bb89d23 100644 --- a/application/hub/classes/pools/peer/class_DefaultPeerPool.php +++ b/application/hub/classes/pools/peer/class_DefaultPeerPool.php @@ -112,12 +112,13 @@ class DefaultPeerPool extends BasePool implements PoolablePeer { } // END - if // Default is this peer's IP - $peerName = '0.0.0.0'; + $peerAddress = '0.0.0.0'; + $peerPort = '0'; // The socket resource should not match server socket if (!$this->getListenerInstance()->getSocketInstance()->equals($socketInstance)) { // Try to determine the peer's IP number - if (!$peerName = $socketInstance->getSocketPeerName()) { + if (!$socketInstance->getSocketPeerName($peerAddress, $peerPort)) { // Handle the socket error with a faked recipientData array $socketInstance->handleSocketError(__METHOD__, __LINE__, array('0.0.0.0', '0')); } // END - if @@ -127,7 +128,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer { } // Debug message - self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL: Adding peer ' . $peerName . ',socketResource=' . $socketInstance->getSocketResource() . ',type=' . $connectionType); + self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL: Adding peer ' . $peerAddress . ':' . $peerPort . ',socketResource=' . $socketInstance->getSocketResource() . ',type=' . $connectionType); // Construct the array $socketArray = array( @@ -254,20 +255,24 @@ class DefaultPeerPool extends BasePool implements PoolablePeer { continue; } // END - if + // Init peer address/port + $peerAddress = '0.0.0.0'; + $peerPort = '0'; + // Try to get the "peer"'s name - if (!$peerName = $socketArray[self::SOCKET_ARRAY_INSTANCE]->getSocketPeerName()) { + if (!$socketArray[self::SOCKET_ARRAY_INSTANCE]->getSocketPeerName($peerAddress, $peerPort)) { // Handle the socket error with given package data $socketArray[self::SOCKET_ARRAY_INSTANCE]->handleSocketError(__METHOD__, __LINE__, explode(':', $packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])); } // END - if // Get // If the "peer" IP and recipient is same, use it - if ($peerName == $unlData[UniversalNodeLocator::UNL_PART_ADDRESS]) { + if ($peerAddress == $unlData[UniversalNodeLocator::UNL_PART_ADDRESS]) { // IPs match, so take the socket and quit this loop $socketInstance = $socketArray[self::SOCKET_ARRAY_INSTANCE]; // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL: peerName=' . $peerName . ' matches with recipient IP address. Taking socket=' . $socketArray[self::SOCKET_ARRAY_INSTANCE] . ',type=' . $socketArray[self::SOCKET_ARRAY_CONN_TYPE]); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('POOL: peerAddress=' . $peerAddress . ' matches with recipient IP address. Taking socket=' . $socketArray[self::SOCKET_ARRAY_INSTANCE] . ',type=' . $socketArray[self::SOCKET_ARRAY_CONN_TYPE]); break; } // END - if } // END - foreach diff --git a/application/hub/config.php b/application/hub/config.php index 4a857330f..b3da98405 100644 --- a/application/hub/config.php +++ b/application/hub/config.php @@ -160,73 +160,73 @@ $cfg->setConfigEntry('hub_console_cmd_main_resolver_class', 'Hub\Resolver\Comman $cfg->setConfigEntry('network_state_resolver_class', 'NetworkStateResolver'); // CFG: NEWS-DOWNLOAD-FILTER -$cfg->setConfigEntry('news_download_filter', 'CoreFramework\Filter\News\NewsDownloadFilter'); +$cfg->setConfigEntry('news_download_filter_class', 'CoreFramework\Filter\News\NewsDownloadFilter'); // CFG: NEWS-PROCESS-FILTER -$cfg->setConfigEntry('news_process_filter', 'CoreFramework\Filter\News\NewsProcessFilter'); +$cfg->setConfigEntry('news_process_filter_class', 'CoreFramework\Filter\News\NewsProcessFilter'); // CFG: NODE-PHP-REQUIREMENTS-FILTER -$cfg->setConfigEntry('node_php_requirements_filter', 'Hub\Filter\Node\Requirements\NodePhpRequirementsFilter'); +$cfg->setConfigEntry('node_php_requirements_filter_class', 'Hub\Filter\Node\Requirements\NodePhpRequirementsFilter'); // CFG: NODE-INITIALIZER-FILTER -$cfg->setConfigEntry('node_initializer_filter', 'Hub\Filter\Node\Initialization\NodeInitializationFilter'); +$cfg->setConfigEntry('node_initializer_filter_class', 'Hub\Filter\Node\Initialization\NodeInitializationFilter'); // CFG: NODE-ACTIVATION-TASK-HANDLER-INITIALIZER-FILTER -$cfg->setConfigEntry('node_activation_task_handler_initializer_filter', 'Hub\Filter\Initializer\Node\Handler\Task\NodeTaskHandlerInitializerFilter'); +$cfg->setConfigEntry('node_activation_task_handler_initializer_filter_class', 'Hub\Filter\Initializer\Node\Handler\Task\NodeTaskHandlerInitializerFilter'); // CFG: NODE-ACTIVATION-ANNOUNCEMENT-TASK-FILTER -$cfg->setConfigEntry('node_activation_announcement_task_filter', 'NodeActivationAnnouncementFilter'); +$cfg->setConfigEntry('node_activation_announcement_task_filter_class', 'NodeActivationAnnouncementFilter'); // CFG: NODE-WELCOME-TEASER-FILTER -$cfg->setConfigEntry('node_welcome_teaser_filter', 'Hub\Filter\Node\WelcomeTeaser\NodeWelcomeTeaserFilter'); +$cfg->setConfigEntry('node_welcome_teaser_filter_class', 'Hub\Filter\Node\WelcomeTeaser\NodeWelcomeTeaserFilter'); // CFG: NODE-BOOTSTRAP-GENERATE-NODEID-FILTER -$cfg->setConfigEntry('node_bootstrap_generate_nodeid_filter', 'Hub\Filter\Bootstrap\Node\NodeId\NodeBootstrapGenerateNodeIdFilter'); +$cfg->setConfigEntry('node_bootstrap_generate_nodeid_filter_class', 'Hub\Filter\Bootstrap\Node\NodeId\NodeBootstrapGenerateNodeIdFilter'); // CFG: NODE-BOOTSTRAP-GENERATE-SESSIONID-FILTER -$cfg->setConfigEntry('node_bootstrap_generate_sessionid_filter', 'Hub\Filter\Bootstrap\Node\SessionId\NodeBootstrapGenerateSessionIdFilter'); +$cfg->setConfigEntry('node_bootstrap_generate_sessionid_filter_class', 'Hub\Filter\Bootstrap\Node\SessionId\NodeBootstrapGenerateSessionIdFilter'); // CFG: NODE-BOOTSTRAP-GENERATE-PRIVATE-KEY-FILTER -$cfg->setConfigEntry('node_bootstrap_generate_private_key_filter', 'Hub\Filter\Bootstrap\Node\PrivateKey\NodeBootstrapGeneratePrivateKeyFilter'); +$cfg->setConfigEntry('node_bootstrap_generate_private_key_filter_class', 'Hub\Filter\Bootstrap\Node\PrivateKey\NodeBootstrapGeneratePrivateKeyFilter'); // CFG: NODE-BOOTSTRAP-EXTRA-BOOTSTRAPPING-FILTER -$cfg->setConfigEntry('node_bootstrap_extra_bootstrapping_filter', 'Hub\Filter\Bootstrap\Node\Extra\NodeBootstrapExtraBootstrappingFilter'); +$cfg->setConfigEntry('node_bootstrap_extra_bootstrapping_filter_class', 'Hub\Filter\Bootstrap\Node\Extra\NodeBootstrapExtraBootstrappingFilter'); // CFG: NODE-BOOTSTRAP-LISTENER-POOL-FILTER -$cfg->setConfigEntry('node_bootstrap_listener_pool_filter', 'Hub\Filter\Bootstrap\Node\Pool\NodeBootstrapListenerPoolFilter'); +$cfg->setConfigEntry('node_bootstrap_listener_pool_filter_class', 'Hub\Filter\Bootstrap\Node\Pool\NodeBootstrapListenerPoolFilter'); // CFG: NODE-SHUTDOWN-FLUSH-NODE-LIST-FILTER -$cfg->setConfigEntry('node_shutdown_flush_node_list_filter', 'Hub\Filter\Shutdown\Node\NodeList\NodeShutdownFlushNodeListFilter'); +$cfg->setConfigEntry('node_shutdown_flush_node_list_filter_class', 'Hub\Filter\Shutdown\Node\NodeList\NodeShutdownFlushNodeListFilter'); // CFG: NODE-SHUTDOWN-TASK-HANDLER-FILTER -$cfg->setConfigEntry('node_shutdown_task_handler_filter', 'Hub\Filter\Shutdown\Node\Handler\Task\NodeShutdownTaskHandlerFilter'); +$cfg->setConfigEntry('node_shutdown_task_handler_filter_class', 'Hub\Filter\Shutdown\Node\Handler\Task\NodeShutdownTaskHandlerFilter'); // CFG: NODE-SHUTDOWN-NODE-FILTER -$cfg->setConfigEntry('node_shutdown_node_filter', 'Hub\Filter\Shutdown\Node\NodeShutdownNodeFilter'); +$cfg->setConfigEntry('node_shutdown_node_filter_class', 'Hub\Filter\Shutdown\Node\NodeShutdownNodeFilter'); // CFG: PACKAGE-FILTER-CHAIN-CLASS $cfg->setConfigEntry('package_filter_chain_class', 'PackageFilterChain'); // CFG: PACKAGE-TAG-ANNOUNCEMENT-FILTER -$cfg->setConfigEntry('package_tag_announcement_filter', 'PackageAnnouncementTagFilter'); +$cfg->setConfigEntry('package_tag_announcement_filter_class', 'PackageAnnouncementTagFilter'); // CFG: PACKAGE-TAG-ANNOUNCEMENT-ANSWER-FILTER -$cfg->setConfigEntry('package_tag_announcement_answer_filter', 'PackageAnnouncementAnswerTagFilter'); +$cfg->setConfigEntry('package_tag_announcement_answer_filter_class', 'PackageAnnouncementAnswerTagFilter'); // CFG: PACKAGE-TAG-DHT-BOOTSTRAP-ANSWER-FILTER -$cfg->setConfigEntry('package_tag_dht_bootstrap_answer_filter', 'PackageDhtBootstrapAnswerTagFilter'); +$cfg->setConfigEntry('package_tag_dht_bootstrap_answer_filter_class', 'PackageDhtBootstrapAnswerTagFilter'); // CFG: PACKAGE-TAG-SELF-CONNECT-FILTER -$cfg->setConfigEntry('package_tag_self_connect_filter', 'PackageSelfConnectTagFilter'); +$cfg->setConfigEntry('package_tag_self_connect_filter_class', 'PackageSelfConnectTagFilter'); // CFG: PACKAGE-TAG-REQUEST-NODE-LIST-FILTER -$cfg->setConfigEntry('package_tag_request_node_list_filter', 'PackageRequestNodeListTagFilter'); +$cfg->setConfigEntry('package_tag_request_node_list_filter_class', 'PackageRequestNodeListTagFilter'); // CFG: PACKAGE-TAG-REQUEST-NODE-LIST-ANSWER-FILTER -$cfg->setConfigEntry('package_tag_request_node_list_answer_filter', 'PackageRequestNodeListAnswerTagFilter'); +$cfg->setConfigEntry('package_tag_request_node_list_answer_filter_class', 'PackageRequestNodeListAnswerTagFilter'); // CFG: PACKAGE-TAG-DHT-BOOTSTRAP-FILTER -$cfg->setConfigEntry('package_tag_dht_bootstrap_filter', 'PackageDhtBootstrapTagFilter'); +$cfg->setConfigEntry('package_tag_dht_bootstrap_filter_class', 'PackageDhtBootstrapTagFilter'); // CFG: MESSAGE-TYPE-ANNOUNCEMENT-HANDLER-CLASS $cfg->setConfigEntry('message_type_announcement_handler_class', 'NodeMessageAnnouncementHandler'); @@ -945,28 +945,28 @@ $cfg->setConfigEntry('miner_buffer_stacker_class', 'CoreFramework\Stacker\FiFoSt $cfg->setConfigEntry('hub_console_cmd_miner_resolver_class', 'Hub\Resolver\Command\HubConsoleCommandResolver'); // CFG: MINER-PHP-REQUIREMENTS-FILTER -$cfg->setConfigEntry('miner_php_requirements_filter', 'MinerPhpRequirementsFilter'); +$cfg->setConfigEntry('miner_php_requirements_filter_class', 'MinerPhpRequirementsFilter'); // CFG: MINER-INITIALIZER-FILTER -$cfg->setConfigEntry('miner_initializer_filter', 'MinerInitializationFilter'); +$cfg->setConfigEntry('miner_initializer_filter_class', 'MinerInitializationFilter'); // CFG: MINER-WELCOME-TEASER-FILTER -$cfg->setConfigEntry('miner_welcome_teaser_filter', 'MinerWelcomeTeaserFilter'); +$cfg->setConfigEntry('miner_welcome_teaser_filter_class', 'MinerWelcomeTeaserFilter'); // CFG: MINER-BOOTSTRAP-TASK-HANDLER-INITIALIZER-FILTER -$cfg->setConfigEntry('miner_bootstrap_task_handler_initializer_filter', 'MinerTaskHandlerInitializerFilter'); +$cfg->setConfigEntry('miner_bootstrap_task_handler_initializer_filter_class', 'MinerTaskHandlerInitializerFilter'); // CFG: CRUNCHER-BOOTSTRAP-EXTRA-BOOTSTRAPPING-FILTER -$cfg->setConfigEntry('miner_bootstrap_extra_bootstrapping_filter', 'MinerBootstrapExtraBootstrappingFilter'); +$cfg->setConfigEntry('miner_bootstrap_extra_bootstrapping_filter_class', 'MinerBootstrapExtraBootstrappingFilter'); // CFG: MINHER-BOOTSTRAP-BUFFER-QUEUE-INITIALIZER-FILTER -$cfg->setConfigEntry('miner_bootstrap_buffer_queue_initializer_filter', 'MinerBootstrapBufferQueueInitializerFilter'); +$cfg->setConfigEntry('miner_bootstrap_buffer_queue_initializer_filter_class', 'MinerBootstrapBufferQueueInitializerFilter'); // CFG: MINER-BOOTSTRAP-GENERIC-ACTIVATION-FILTER -$cfg->setConfigEntry('miner_bootstrap_generic_activation_filter', 'MinerBootstrapGenericActivationFilter'); +$cfg->setConfigEntry('miner_bootstrap_generic_activation_filter_class', 'MinerBootstrapGenericActivationFilter'); // CFG: MINER-SHUTDOWN-FILTER -$cfg->setConfigEntry('miner_shutdown_filter', 'MinerShutdownFilter'); +$cfg->setConfigEntry('miner_shutdown_filter_class', 'MinerShutdownFilter'); // CFG: MINER-INIT-STATE-CLASS $cfg->setConfigEntry('miner_init_state_class', 'MinerInitState'); @@ -1051,28 +1051,28 @@ $cfg->setConfigEntry('cruncher_buffer_stacker_class', 'CoreFramework\Stacker\FiF $cfg->setConfigEntry('hub_console_cmd_cruncher_resolver_class', 'Hub\Resolver\Command\HubConsoleCommandResolver'); // CFG: CRUNCHER-PHP-REQUIREMENTS-FILTER -$cfg->setConfigEntry('cruncher_php_requirements_filter', 'CruncherPhpRequirementsFilter'); +$cfg->setConfigEntry('cruncher_php_requirements_filter_class', 'CruncherPhpRequirementsFilter'); // CFG: CRUNCHER-INITIALIZER-FILTER -$cfg->setConfigEntry('cruncher_initializer_filter', 'CruncherInitializationFilter'); +$cfg->setConfigEntry('cruncher_initializer_filter_class', 'CruncherInitializationFilter'); // CFG: CRUNCHER-BOOTSTRAP-TASK-HANDLER-INITIALIZER-FILTER -$cfg->setConfigEntry('cruncher_bootstrap_task_handler_initializer_filter', 'CruncherTaskHandlerInitializerFilter'); +$cfg->setConfigEntry('cruncher_bootstrap_task_handler_initializer_filter_class', 'CruncherTaskHandlerInitializerFilter'); // CFG: CRUNCHER-BOOTSTRAP-EXTRA-BOOTSTRAPPING-FILTER -$cfg->setConfigEntry('cruncher_bootstrap_extra_bootstrapping_filter', 'CruncherBootstrapExtraBootstrappingFilter'); +$cfg->setConfigEntry('cruncher_bootstrap_extra_bootstrapping_filter_class', 'CruncherBootstrapExtraBootstrappingFilter'); // CFG: CRUNCHER-BOOTSTRAP-BUFFER-QUEUE-INITIALIZER-FILTER -$cfg->setConfigEntry('cruncher_bootstrap_buffer_queue_initializer_filter', 'CruncherBootstrapBufferQueueInitializerFilter'); +$cfg->setConfigEntry('cruncher_bootstrap_buffer_queue_initializer_filter_class', 'CruncherBootstrapBufferQueueInitializerFilter'); // CFG: CRUNCHER-BOOTSTRAP-GENERIC-ACTIVATION-FILTER -$cfg->setConfigEntry('cruncher_bootstrap_generic_activation_filter', 'CruncherBootstrapGenericActivationFilter'); +$cfg->setConfigEntry('cruncher_bootstrap_generic_activation_filter_class', 'CruncherBootstrapGenericActivationFilter'); // CFG: CRUNCHER-WELCOME-TEASER-FILTER -$cfg->setConfigEntry('cruncher_welcome_teaser_filter', 'CruncherWelcomeTeaserFilter'); +$cfg->setConfigEntry('cruncher_welcome_teaser_filter_class', 'CruncherWelcomeTeaserFilter'); // CFG: CRUNCHER-SHUTDOWN-FILTER -$cfg->setConfigEntry('cruncher_shutdown_filter', 'CruncherShutdownFilter'); +$cfg->setConfigEntry('cruncher_shutdown_filter_class', 'CruncherShutdownFilter'); // CFG: CRUNCHER-WORK-UNIT-FETCHER-TASK-CLASS $cfg->setConfigEntry('cruncher_work_unit_fetcher_task_class', 'CruncherWorkUnitFetcherTask'); @@ -1190,28 +1190,28 @@ $cfg->setConfigEntry('cruncher_per_unit_key_limit', 1000); $cfg->setConfigEntry('hub_console_cmd_chat_resolver_class', 'Hub\Resolver\Command\HubConsoleCommandResolver'); // CFG: CHAT-PHP-REQUIREMENTS-FILTER -$cfg->setConfigEntry('chat_php_requirements_filter', 'ChatPhpRequirementsFilter'); +$cfg->setConfigEntry('chat_php_requirements_filter_class', 'ChatPhpRequirementsFilter'); // CFG: CHAT-INITIALIZER-FILTER -$cfg->setConfigEntry('chat_initializer_filter', 'ChatInitializationFilter'); +$cfg->setConfigEntry('chat_initializer_filter_class', 'ChatInitializationFilter'); // CFG: NODE-CONSOLE-CHAT $cfg->setConfigEntry('node_console_chat_class', 'NodeConsoleChat'); // CFG: CHAT-WELCOME-TEASER-FILTER -$cfg->setConfigEntry('chat_welcome_teaser_filter', 'ChatWelcomeTeaserFilter'); +$cfg->setConfigEntry('chat_welcome_teaser_filter_class', 'ChatWelcomeTeaserFilter'); // CFG: CHAT-BOOTSTRAP-TASK-HANDLER-INITIALIZER-FILTER -$cfg->setConfigEntry('chat_bootstrap_task_handler_initializer_filter', 'ChatTaskHandlerInitializerFilter'); +$cfg->setConfigEntry('chat_bootstrap_task_handler_initializer_filter_class', 'ChatTaskHandlerInitializerFilter'); // CFG: CHAT-BOOTSTRAP-EXTRA-BOOTSTRAPPING-FILTER -$cfg->setConfigEntry('chat_bootstrap_extra_bootstrapping_filter', 'ChatBootstrapExtraBootstrappingFilter'); +$cfg->setConfigEntry('chat_bootstrap_extra_bootstrapping_filter_class', 'ChatBootstrapExtraBootstrappingFilter'); // CFG: CHAT-BOOTSTRAP-GENERIC-ACTIVATION-FILTER -$cfg->setConfigEntry('chat_bootstrap_generic_activation_filter', 'ChatBootstrapGenericActivationFilter'); +$cfg->setConfigEntry('chat_bootstrap_generic_activation_filter_class', 'ChatBootstrapGenericActivationFilter'); // CFG: CHAT-SHUTDOWN-FILTER -$cfg->setConfigEntry('chat_shutdown_filter', 'ChatShutdownFilter'); +$cfg->setConfigEntry('chat_shutdown_filter_class', 'ChatShutdownFilter'); // CFG: CHAT-TELNET-LISTENER-TASK-CLASS $cfg->setConfigEntry('chat_telnet_listener_task_class', 'ChatTelnetListenerTask'); @@ -1242,28 +1242,28 @@ $cfg->setConfigEntry('index_extension', '.idx'); $cfg->setConfigEntry('hub_console_cmd_crawler_resolver_class', 'Hub\Resolver\Command\HubConsoleCommandResolver'); // CFG: CRAWLER-PHP-REQUIREMENTS-FILTER -$cfg->setConfigEntry('crawler_php_requirements_filter', 'CrawlerPhpRequirementsFilter'); +$cfg->setConfigEntry('crawler_php_requirements_filter_class', 'CrawlerPhpRequirementsFilter'); // CFG: CRAWLER-INITIALIZER-FILTER -$cfg->setConfigEntry('crawler_initializer_filter', 'CrawlerInitializationFilter'); +$cfg->setConfigEntry('crawler_initializer_filter_class', 'CrawlerInitializationFilter'); // CFG: NODE-CONSOLE-CRAWLER $cfg->setConfigEntry('node_console_crawler_class', 'NodeConsoleCrawler'); // CFG: CRAWLER-WELCOME-TEASER-FILTER -$cfg->setConfigEntry('crawler_welcome_teaser_filter', 'CrawlerWelcomeTeaserFilter'); +$cfg->setConfigEntry('crawler_welcome_teaser_filter_class', 'CrawlerWelcomeTeaserFilter'); // CFG: CRAWLER-BOOTSTRAP-TASK-HANDLER-INITIALIZER-FILTER -$cfg->setConfigEntry('crawler_bootstrap_task_handler_initializer_filter', 'CrawlerTaskHandlerInitializerFilter'); +$cfg->setConfigEntry('crawler_bootstrap_task_handler_initializer_filter_class', 'CrawlerTaskHandlerInitializerFilter'); // CFG: CRAWLER-BOOTSTRAP-EXTRA-BOOTSTRAPPING-FILTER -$cfg->setConfigEntry('crawler_bootstrap_extra_bootstrapping_filter', 'CrawlerBootstrapExtraBootstrappingFilter'); +$cfg->setConfigEntry('crawler_bootstrap_extra_bootstrapping_filter_class', 'CrawlerBootstrapExtraBootstrappingFilter'); // CFG: CRAWLER-BOOTSTRAP-GENERIC-ACTIVATION-FILTER -$cfg->setConfigEntry('crawler_bootstrap_generic_activation_filter', 'CrawlerBootstrapGenericActivationFilter'); +$cfg->setConfigEntry('crawler_bootstrap_generic_activation_filter_class', 'CrawlerBootstrapGenericActivationFilter'); // CFG: CRAWLER-SHUTDOWN-FILTER -$cfg->setConfigEntry('crawler_shutdown_filter', 'CrawlerShutdownFilter'); +$cfg->setConfigEntry('crawler_shutdown_filter_class', 'CrawlerShutdownFilter'); // CFG: CRAWLER-NODE-COMMUNICATOR-CLASS $cfg->setConfigEntry('crawler_node_communicator_class', 'CrawlerNodeCommunicator'); @@ -1510,28 +1510,28 @@ $cfg->setConfigEntry('crawler_url_list_column_separator', ','); $cfg->setConfigEntry('hub_console_cmd_apt_proxy_resolver_class', 'Hub\Resolver\Command\HubConsoleCommandResolver'); // CFG: APT-PROXY-PHP-REQUIREMENTS-FILTER -$cfg->setConfigEntry('apt_proxy_php_requirements_filter', 'AptProxyPhpRequirementsFilter'); +$cfg->setConfigEntry('apt_proxy_php_requirements_filter_class', 'AptProxyPhpRequirementsFilter'); // CFG: APT-PROXY-INITIALIZER-FILTER -$cfg->setConfigEntry('apt_proxy_initializer_filter', 'AptProxyInitializationFilter'); +$cfg->setConfigEntry('apt_proxy_initializer_filter_class', 'AptProxyInitializationFilter'); // CFG: NODE-CONSOLE-APT-PROXY $cfg->setConfigEntry('node_console_apt_proxy_class', 'NodeConsoleAptProxy'); // CFG: APT-PROXY-WELCOME-TEASER-FILTER -$cfg->setConfigEntry('apt_proxy_welcome_teaser_filter', 'AptProxyWelcomeTeaserFilter'); +$cfg->setConfigEntry('apt_proxy_welcome_teaser_filter_class', 'AptProxyWelcomeTeaserFilter'); // CFG: APT-PROXY-BOOTSTRAP-TASK-HANDLER-INITIALIZER-FILTER -$cfg->setConfigEntry('apt_proxy_bootstrap_task_handler_initializer_filter', 'AptProxyTaskHandlerInitializerFilter'); +$cfg->setConfigEntry('apt_proxy_bootstrap_task_handler_initializer_filter_class', 'AptProxyTaskHandlerInitializerFilter'); // CFG: APT-PROXY-BOOTSTRAP-EXTRA-BOOTSTRAPPING-FILTER -$cfg->setConfigEntry('apt_proxy_bootstrap_extra_bootstrapping_filter', 'AptProxyBootstrapExtraBootstrappingFilter'); +$cfg->setConfigEntry('apt_proxy_bootstrap_extra_bootstrapping_filter_class', 'AptProxyBootstrapExtraBootstrappingFilter'); // CFG: APT-PROXY-BOOTSTRAP-GENERIC-ACTIVATION-FILTER -$cfg->setConfigEntry('apt_proxy_bootstrap_generic_activation_filter', 'AptProxyBootstrapGenericActivationFilter'); +$cfg->setConfigEntry('apt_proxy_bootstrap_generic_activation_filter_class', 'AptProxyBootstrapGenericActivationFilter'); // CFG: APT-PROXY-SHUTDOWN-FILTER -$cfg->setConfigEntry('apt_proxy_shutdown_filter', 'AptProxyShutdownFilter'); +$cfg->setConfigEntry('apt_proxy_shutdown_filter_class', 'AptProxyShutdownFilter'); // CFG: APT-PROXY-LISTENER-TASK-CLASS $cfg->setConfigEntry('apt_proxy_listener_task_class', 'AptProxyListenerTask'); diff --git a/application/hub/interfaces/container/socket/class_StorableSocket.php b/application/hub/interfaces/container/socket/class_StorableSocket.php index 49ee4659e..3afb47d13 100644 --- a/application/hub/interfaces/container/socket/class_StorableSocket.php +++ b/application/hub/interfaces/container/socket/class_StorableSocket.php @@ -100,6 +100,14 @@ interface StorableSocket extends FrameworkInterface { */ function listenOnSocket (); + /** + * Tries to set non-blocking I/O on stored socket + * + * @return $result Result of changing to non-blocking I/O + * @throws InvalidSocketException If socket is valid + */ + function enableSocketNonBlocking (); + /** * Handles socket error for given socket resource and peer data. This method * validates socket resource stored in given container if it is a valid -- 2.39.5