From: Roland Häder Date: Mon, 22 May 2017 16:23:17 +0000 (+0200) Subject: Cleanup: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e82052a027b2eb5e5190c923230b167472b2ed6c;p=hub.git Cleanup: - isServerSocketResource() was at the start a good idea, to make sure that only "server" (listeners) sockets can pass but it was hindering it when it comes to UDP where there is no connection. - so let's better remove this method all together - updated TODOs.txt Signed-off-by: Roland Häder --- diff --git a/application/hub/classes/container/socket/class_SocketContainer.php b/application/hub/classes/container/socket/class_SocketContainer.php index ab45aca98..a146286cb 100644 --- a/application/hub/classes/container/socket/class_SocketContainer.php +++ b/application/hub/classes/container/socket/class_SocketContainer.php @@ -56,6 +56,11 @@ class SocketContainer extends BaseContainer implements StorableSocket, Visitable */ private $socketProtocol = StorableSocket::SOCKET_PROTOCOL_INVALID; + /** + * An array with all valid connection types + */ + private $connectionTypes = array(); + /** * Protected constructor * @@ -64,6 +69,13 @@ class SocketContainer extends BaseContainer implements StorableSocket, Visitable protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); + + // Init array of connection types + $this->connectionTypes = array( + StorableSocket::CONNECTION_TYPE_INCOMING, + StorableSocket::CONNECTION_TYPE_OUTGOING, + StorableSocket::CONNECTION_TYPE_SERVER + ); } /** @@ -162,61 +174,6 @@ class SocketContainer extends BaseContainer implements StorableSocket, Visitable return $matches; } - /** - * Checks whether the stored socket resource is a server socket - * - * @return $isServerSocket Whether the stored socket resource is a server socket - * @throws LogicException If SOCKET_ARRAY_INDEX_FILE is not set in packageData - */ - public function isServerSocketResource () { - // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($this->getSocketProtocol()) . '-SOCKET: Testing if server socket - CALLED!'); - - // Init peer address/port - $peerAddress = '0.0.0.0'; - $peerPort = '0'; - - // Is socket file? - if ($this->getSocketProtocol() == StorableSocket::SOCKET_PROTOCOL_FILE) { - // Get package data - $packageData = $this->getPackageData(); - - // Is it there? - if (!isset($packageData[StorableSocket::SOCKET_ARRAY_INDEX_FILE])) { - // Is not set - throw new LogicException(sprintf('packageData[%s] is not set.', StorableSocket::SOCKET_ARRAY_INDEX_FILE)); - } // END - if - - // Set file as peer address - $peerAddress = $packageData[StorableSocket::SOCKET_ARRAY_INDEX_FILE]; - } // END - if - - // Check it - $isServerSocket = (($this->isValidSocket()) && ($this->getSocketPeerName($peerAddress, $peerPort) === FALSE)); - - // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: isServerSocket=%d', strtoupper($this->getSocketProtocol()), intval($isServerSocket))); - - // Need to clear the error here if it is a resource - if ($isServerSocket === true) { - // Clear the error - //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('socketResource[]=' . gettype($this->getSocketResource(0)); - $this->clearLastSocketError(); - } // END - if - - // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: peerAddress=%s,peerPort=%d', strtoupper($this->getSocketProtocol()), $peerAddress, $peerPort)); - - // Check peer name, it must be empty - // @TODO: $isServerSocket = (($isServerSocket) && ($peerAddress === '0.0.0.0') && ($peerPort === '0')); - - // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf(strtoupper($this->getSocketProtocol()) . '-SOCKET: isServerSocket=%d - EXIT!', intval($isServerSocket))); - - // Return result - return $isServerSocket; - } - /** * Shuts down a given socket resource. This method does only ease calling * the right visitor. @@ -521,7 +478,6 @@ class SocketContainer extends BaseContainer implements StorableSocket, Visitable * @return void * @throws InvalidSocketException If the stored socket resource 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 */ public final function handleSocketError ($method, $line, array $socketData) { // Trace message @@ -887,4 +843,18 @@ class SocketContainer extends BaseContainer implements StorableSocket, Visitable /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($this->getSocketProtocol()) . '-SOCKET: Error cleared - EXIT!'); } + /** + * Checks whether the given connection type is valid + * + * @param $connectionType Type of connection, can be 'incoming', 'outgoing' or 'server' + * @return $isValid Whether the provided connection type is valid + */ + private function isValidConnectionType ($connectionType) { + // Is it valid? + $isValid = in_array($connectionType, $this->connectionTypes, TRUE); + + // Return result + return $isValid; + } + } diff --git a/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php b/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php index 4d13f8375..371a3862a 100644 --- a/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php +++ b/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php @@ -8,7 +8,6 @@ use Hub\Factory\Node\NodeObjectFactory; use Hub\Factory\Socket\SocketFactory; use Hub\Generic\BaseHubSystem; use Hub\Handler\Protocol\HandleableProtocol; -use Hub\Helper\Connection\BaseConnectionHelper; use Hub\Listener\Listenable; use Hub\Network\Package\NetworkPackage; @@ -138,7 +137,7 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(': connectionType=' . $connectionType . ' - CALLED!'); // Assert on type and recipient - assert($connectionType != BaseConnectionHelper::CONNECTION_TYPE_SERVER); + assert($connectionType != StorableSocket::CONNECTION_TYPE_SERVER); assert(isset($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])); // Determine protocol instance diff --git a/application/hub/classes/helper/connection/class_BaseConnectionHelper.php b/application/hub/classes/helper/connection/class_BaseConnectionHelper.php index b5b8ca22f..7aa0ab597 100644 --- a/application/hub/classes/helper/connection/class_BaseConnectionHelper.php +++ b/application/hub/classes/helper/connection/class_BaseConnectionHelper.php @@ -40,21 +40,6 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Visitable, Reg // Exception codes const EXCEPTION_UNSUPPORTED_ERROR_HANDLER = 0x9100; - /** - * Connection type 'incoming' - */ - const CONNECTION_TYPE_INCOMING = 'incoming'; - - /** - * Connection type 'outgoing' - */ - const CONNECTION_TYPE_OUTGOING = 'outgoing'; - - /** - * Connection type 'server' - */ - const CONNECTION_TYPE_SERVER = 'server'; - /** * (IP) Adress used */ diff --git a/application/hub/classes/listener/class_BaseListener.php b/application/hub/classes/listener/class_BaseListener.php index e1aef689a..575aca243 100644 --- a/application/hub/classes/listener/class_BaseListener.php +++ b/application/hub/classes/listener/class_BaseListener.php @@ -6,7 +6,6 @@ namespace Hub\Listener; use Hub\Container\Socket\StorableSocket; use Hub\Factory\Information\Connection\ConnectionInfoFactory; use Hub\Generic\BaseHubSystem; -use Hub\Helper\Connection\BaseConnectionHelper; use Hub\Network\Package\NetworkPackage; use Hub\Pool\Peer\PoolablePeer; use Hub\Pool\Poolable; @@ -167,18 +166,14 @@ class BaseListener extends BaseHubSystem implements Visitable { * * @param $socketInstance An instance of a StorableSocket class * @return void - * @throws InvalidServerSocketException If the given resource is no server socket * @throws SocketAlreadyRegisteredException If the given resource is already registered */ protected function registerServerSocketInstance (StorableSocket $socketInstance) { // First check if it is valid - if (!$socketInstance->isServerSocketResource()) { - // No server socket - throw new InvalidServerSocketException(array($this, $socketInstance->getSocketResource()), self::EXCEPTION_INVALID_SOCKET); - } elseif ($this->isServerSocketRegistered($socketInstance)) { + if ($this->isServerSocketRegistered($socketInstance)) { // Already registered throw new SocketAlreadyRegisteredException($this, self::EXCEPTION_SOCKET_ALREADY_REGISTERED); - } + } // END - if // Get a socket registry instance (singleton) $registryInstance = SocketRegistryFactory::createSocketRegistryInstance(); @@ -338,7 +333,7 @@ class BaseListener extends BaseHubSystem implements Visitable { } // END - if // Add it to the peers - $this->getPoolInstance()->addPeer($newSocket, BaseConnectionHelper::CONNECTION_TYPE_INCOMING); + $this->getPoolInstance()->addPeer($newSocket, StorableSocket::CONNECTION_TYPE_INCOMING); // Init peer address/port $peerAddress = '0.0.0.0'; @@ -384,7 +379,7 @@ class BaseListener extends BaseHubSystem implements Visitable { // Handle it here, if not main server socket //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER: currentSocketData=' . $currentSocketData[Poolable::SOCKET_ARRAY_INSTANCE] . ',type=' . $currentSocketData[Poolable::SOCKET_ARRAY_CONN_TYPE] . ',serverSocket=' . $this->getSocketInstance()->getSocketResource()); - if (($currentSocketData[Poolable::SOCKET_ARRAY_CONN_TYPE] != BaseConnectionHelper::CONNECTION_TYPE_SERVER) && (!$currentSocketData[Poolable::SOCKET_ARRAY_INSTANCE]->equals($this->getSocketInstance()))) { + if (($currentSocketData[Poolable::SOCKET_ARRAY_CONN_TYPE] != StorableSocket::CONNECTION_TYPE_SERVER) && (!$currentSocketData[Poolable::SOCKET_ARRAY_INSTANCE]->equals($this->getSocketInstance()))) { // ... or else it will raise warnings like 'Transport endpoint is not connected' $this->getHandlerInstance()->processRawDataFromResource($currentSocketData); } // END - if diff --git a/application/hub/classes/listener/socket/class_SocketFileListener.php b/application/hub/classes/listener/socket/class_SocketFileListener.php index aec290c23..10abef303 100644 --- a/application/hub/classes/listener/socket/class_SocketFileListener.php +++ b/application/hub/classes/listener/socket/class_SocketFileListener.php @@ -5,7 +5,6 @@ namespace Hub\Listener\Socket; // Import application-specific stuff use Hub\Container\Socket\StorableSocket; use Hub\Factory\Socket\SocketFactory; -use Hub\Helper\Connection\BaseConnectionHelper; use Hub\Listener\BaseListener; use Hub\Listener\Listenable; @@ -78,7 +77,7 @@ class SocketFileListener extends BaseListener implements Listenable { $poolInstance = ObjectFactory::createObjectByConfiguredName('application_pool_class', array($this)); // Add main socket - $poolInstance->addPeer($socketInstance, BaseConnectionHelper::CONNECTION_TYPE_SERVER); + $poolInstance->addPeer($socketInstance, StorableSocket::CONNECTION_TYPE_SERVER); // And add it to this listener $this->setPoolInstance($poolInstance); diff --git a/application/hub/classes/listener/tcp/class_TcpListener.php b/application/hub/classes/listener/tcp/class_TcpListener.php index 9c39cad4d..6d09063ef 100644 --- a/application/hub/classes/listener/tcp/class_TcpListener.php +++ b/application/hub/classes/listener/tcp/class_TcpListener.php @@ -3,8 +3,8 @@ namespace Hub\Listener\Tcp; // Import application-specific stuff +use Hub\Container\Socket\StorableSocket; use Hub\Factory\Socket\SocketFactory; -use Hub\Helper\Connection\BaseConnectionHelper; use Hub\Listener\BaseListener; use Hub\Listener\Listenable; @@ -65,8 +65,6 @@ class TcpListener extends BaseListener implements Listenable { * Initializes the listener by setting up the required socket server * * @return void - * @throws InvalidSocketException Thrown if the socket could not be initialized - * @todo Needs rewrite! */ public function initListener () { // Get instance from socket factory @@ -79,7 +77,7 @@ class TcpListener extends BaseListener implements Listenable { $poolInstance = ObjectFactory::createObjectByConfiguredName('node_pool_class', array($this)); // Add main socket - $poolInstance->addPeer($socketInstance, BaseConnectionHelper::CONNECTION_TYPE_SERVER); + $poolInstance->addPeer($socketInstance, StorableSocket::CONNECTION_TYPE_SERVER); // And add it to this listener $this->setPoolInstance($poolInstance); diff --git a/application/hub/classes/package/class_NetworkPackage.php b/application/hub/classes/package/class_NetworkPackage.php index 5276e079b..693c94c43 100644 --- a/application/hub/classes/package/class_NetworkPackage.php +++ b/application/hub/classes/package/class_NetworkPackage.php @@ -10,7 +10,6 @@ use Hub\Factory\Information\Connection\ConnectionInfoFactory; use Hub\Factory\Node\NodeObjectFactory; use Hub\Generic\BaseHubSystem; use Hub\Handler\RawData\BaseRawDataHandler; -use Hub\Helper\Connection\BaseConnectionHelper; use Hub\Helper\Connection\ConnectionHelper; use Hub\Helper\HubHelper; use Hub\Information\ShareableInfo; @@ -612,8 +611,8 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R */ $discoveryInstance = SocketDiscoveryFactory::createSocketDiscoveryInstance(); - // Now discover the right protocol - $socketInstance = $discoveryInstance->discoverSocket($packageData, BaseConnectionHelper::CONNECTION_TYPE_OUTGOING); + // Now discover the right socket instance from given package data + $socketInstance = $discoveryInstance->discoverSocket($packageData, StorableSocket::CONNECTION_TYPE_OUTGOING); // Debug message //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE: Reached line ' . __LINE__ . ' after discoverSocket() has been called.'); diff --git a/application/hub/classes/pools/class_BasePool.php b/application/hub/classes/pools/class_BasePool.php index a95573cd7..37bb41277 100644 --- a/application/hub/classes/pools/class_BasePool.php +++ b/application/hub/classes/pools/class_BasePool.php @@ -4,7 +4,6 @@ namespace Hub\Pool; // Import hub-specific stuff use Hub\Generic\BaseHubSystem; -use Hub\Helper\Connection\BaseConnectionHelper; use Hub\Pool\Poolable; // Import framework stuff @@ -41,11 +40,6 @@ abstract class BasePool extends BaseHubSystem implements Poolable, Visitable { */ private $poolEntriesInstance = NULL; - /** - * An array with all valid connection types - */ - private $connectionTypes = array(); - /** * Protected constructor * @@ -58,13 +52,6 @@ abstract class BasePool extends BaseHubSystem implements Poolable, Visitable { // Init the pool entries $this->poolEntriesInstance = ObjectFactory::createObjectByConfiguredName('pool_entries_list_class'); - - // Init array of connection types - $this->connectionTypes = array( - BaseConnectionHelper::CONNECTION_TYPE_INCOMING, - BaseConnectionHelper::CONNECTION_TYPE_OUTGOING, - BaseConnectionHelper::CONNECTION_TYPE_SERVER - ); } /** @@ -179,20 +166,6 @@ abstract class BasePool extends BaseHubSystem implements Poolable, Visitable { return $array; } - /** - * Checks whether the given connection type is valid - * - * @param $connectionType Type of connection, can be 'incoming', 'outgoing' or 'server' - * @return $isValid Whether the provided connection type is valid - */ - protected function isValidConnectionType ($connectionType) { - // Is it valid? - $isValid = in_array($connectionType, $this->connectionTypes, TRUE); - - // Return result - return $isValid; - } - /** * Run the pre-shutdown seqeuence by a visitor pattern * diff --git a/application/hub/interfaces/container/socket/class_StorableSocket.php b/application/hub/interfaces/container/socket/class_StorableSocket.php index b45438da6..815acb5d9 100644 --- a/application/hub/interfaces/container/socket/class_StorableSocket.php +++ b/application/hub/interfaces/container/socket/class_StorableSocket.php @@ -58,6 +58,21 @@ interface StorableSocket extends FrameworkInterface { const SOCKET_PROTOCOL_TCP = 'tcp'; const SOCKET_PROTOCOL_UDP = 'udp'; + /** + * Connection type 'incoming' + */ + const CONNECTION_TYPE_INCOMING = 'incoming'; + + /** + * Connection type 'outgoing' + */ + const CONNECTION_TYPE_OUTGOING = 'outgoing'; + + /** + * Connection type 'server' + */ + const CONNECTION_TYPE_SERVER = 'server'; + /** * Tries to bind the socket. * @@ -124,13 +139,6 @@ interface StorableSocket extends FrameworkInterface { */ function ifSocketResourceMatches ($socketResource); - /** - * Checks whether the stored socket resource is a server socket - * - * @return $isServerSocket Whether the stored socket resource is a server socket - */ - function isServerSocketResource (); - /** * Shuts down a given socket resource. This method does only ease calling * the right visitor. @@ -182,7 +190,6 @@ interface StorableSocket extends FrameworkInterface { * @return void * @throws InvalidSocketException If the stored socket resource 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 */ function handleSocketError ($method, $line, array $socketData); diff --git a/docs/TODOs.txt b/docs/TODOs.txt index 988a00122..46615dde6 100644 --- a/docs/TODOs.txt +++ b/docs/TODOs.txt @@ -2,7 +2,6 @@ ### DO NOT EDIT THIS FILE. ### ./application/hub/class_ApplicationHelper.php:264: * @todo Nothing to add? ./application/hub/classes/chains/class_PackageFilterChain.php:60: * @todo This may be slow if a message with a lot tags arrived -./application/hub/classes/class_BaseHubSystem.php:145: * @todo Move all this socket-related stuff into own class, most of it resides in BaseListener ./application/hub/classes/commands/console/class_HubConsoleAptProxyCommand.php:120: * @todo Should we add some more filters? ./application/hub/classes/commands/console/class_HubConsoleAptProxyCommand.php:71: * @todo Try to create a AptProxyActivationTask or so ./application/hub/classes/commands/console/class_HubConsoleChatCommand.php:120: * @todo Should we add some more filters? @@ -16,18 +15,22 @@ ./application/hub/classes/commands/console/class_HubConsoleMinerCommand.php:120: * @todo Should we add some more filters? ./application/hub/classes/commands/console/class_HubConsoleMinerCommand.php:71: * @todo Try to create a MinerActivationTask or so ./application/hub/classes/commands/html/class_HubHtmlIndexCommand.php:94: * @todo 0% done +./application/hub/classes/container/socket/class_SocketContainer.php:295: // @TODO maybe add more checks? is_resource() is still to less +./application/hub/classes/container/socket/class_SocketContainer.php:435: * @todo We may want to implement a filter for ease notification of other objects like our pool +./application/hub/classes/container/socket/class_SocketContainer.php:436: * @todo rewrite this! +./application/hub/classes/container/socket/class_SocketContainer.php:772: // @TODO On some systems it is 134, on some 107? ./application/hub/classes/crawler/class_BaseNodeCrawler.php:72: * @todo 0% done -./application/hub/classes/cruncher/class_BaseHubCruncher.php:215: * @todo Try to make this method more generic so we can move it in BaseFrameworkSystem +./application/hub/classes/cruncher/class_BaseHubCruncher.php:214: * @todo Try to make this method more generic so we can move it in BaseFrameworkSystem ./application/hub/classes/cruncher/mcrypt/class_HubMcryptCruncher.php:107: // @TODO Implement this method ./application/hub/classes/cruncher/mcrypt/class_HubMcryptCruncher.php:117: * @todo Implement this method ./application/hub/classes/cruncher/mcrypt/class_HubMcryptCruncher.php:147: * @todo 0% done ./application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php:181: // @TODO Bad check on UNL, better use a proper validator -./application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php:227: // @TODO Bad check on UNL, better use a proper validator -./application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php:460: // @TODO Unimplemented part -./application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php:527: * @todo Add minimum/maximum age limitations -./application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php:558: * @todo Add timestamp to dataset instance -./application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php:188: * @todo Unfinished area -./application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php:230: * @todo Unfinished area, please rewrite! +./application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php:226: // @TODO Bad check on UNL, better use a proper validator +./application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php:459: // @TODO Unimplemented part +./application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php:526: * @todo Add minimum/maximum age limitations +./application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php:557: * @todo Add timestamp to dataset instance +./application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php:192: * @todo Unfinished area +./application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php:234: * @todo Unfinished area, please rewrite! ./application/hub/classes/dht/class_BaseDht.php:135: * @todo Add minimum/maximum age limitations ./application/hub/classes/dht/class_BaseDht.php:169: // @TODO Maybe add more small checks? ./application/hub/classes/dht/class_BaseDht.php:211: * @todo Find out if loadDescriptorXml() can be called only once to avoid a lot methods working. @@ -41,7 +44,8 @@ ./application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php:96: * @todo Add some validation of recipient field, e.g. an Universal Node Locator is found ./application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php:97: * @todo Enrich both messages with recipient data ./application/hub/classes/factories/handler/class_ProtocolHandlerFactory.php:20: * @todo Unfinished stuff -./application/hub/classes/factories/socket/class_SocketFactory.php:22: * @todo Find an interface for hub helper +./application/hub/classes/factories/socket/class_SocketFactory.php:188: * @todo Rewrite this to also handle IPv6 addresses and sockets +./application/hub/classes/factories/socket/class_SocketFactory.php:27: * @todo Find an interface for hub helper ./application/hub/classes/filter/apt-proxy/class_AptProxyInitializationFilter.php:64: * @todo 0% done ./application/hub/classes/filter/apt-proxy/class_AptProxyPhpRequirementsFilter.php:63: * @todo Add more test and try to add an extra message to the thrown exception ./application/hub/classes/filter/apt-proxy/class_AptProxyWelcomeTeaserFilter.php:64: * @todo Handle over the $responseInstance to outputConsoleTeaser() @@ -87,20 +91,18 @@ ./application/hub/classes/handler/message-types/answer/class_NodeMessageDhtBootstrapAnswerHandler.php:102: * @todo ~30% done ./application/hub/classes/handler/message-types/self-connect/class_NodeMessageSelfConnectHandler.php:83: // @TODO Throw an exception here instead of dying ./application/hub/classes/handler/network/udp/class_UdpRawDataHandler.php:66: * @todo 0% -./application/hub/classes/handler/protocol/class_BaseProtocolHandler.php:117: * @TODO If you know why, please fix and explain it to me. -./application/hub/classes/handler/raw_data/network/class_BaseRawDataHandler.php:159: * @todo This method will be moved to a better place +./application/hub/classes/handler/protocol/class_BaseProtocolHandler.php:109: * @TODO If you know why, please fix and explain it to me. +./application/hub/classes/handler/protocol/ipv4/class_BaseIpV4ProtocolHandler.php:101: // @TODO don't do this in a isValidFoo() method +./application/hub/classes/handler/raw_data/network/class_BaseRawDataHandler.php:142: * @todo This method will be moved to a better place ./application/hub/classes/helper/class_BaseHubSystemHelper.php:93: * @todo 0% done -./application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php:110: * @todo Rewrite the while() loop to a iterator to not let the software stay very long here -./application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php:18: * @todo Find an interface for hub helper -./application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php:82: // @TODO Move this to the socket error handler -./application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php:127: // @TODO Rewrite this test for UNLs -./application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php:134: // @TODO Rewrite this test for UNLs -./application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php:167: * @todo We may want to implement a filter for ease notification of other objects like our pool -./application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php:19: * @todo Find an interface for hub helper -./application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php:58: * @todo $errorCode/-Message are now in handleSocketError()'s call-back methods -./application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php:98: // @TODO The whole resolving part should be moved out and made more configurable -./application/hub/classes/helper/connection/ipv4/udp/class_UdpConnectionHelper.php:16: * @todo Find an interface for hub helper -./application/hub/classes/helper/connection/ipv4/udp/class_UdpConnectionHelper.php:62: * @todo Implement a filter for ease notification of other objects like the pool +./application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php:17: * @todo Find an interface for hub helper +./application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php:75: * @todo Rewrite the while() loop to a iterator to not let the software stay very long here +./application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php:100: // @TODO Rewrite this test for UNLs +./application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php:137: * @todo rewrite this! +./application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php:69: // @TODO The whole resolving part should be moved out and made more configurable +./application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php:93: // @TODO Rewrite this test for UNLs +./application/hub/classes/helper/connection/ipv4/udp/class_UdpConnectionHelper.php:17: * @todo Find an interface for hub helper +./application/hub/classes/helper/connection/ipv4/udp/class_UdpConnectionHelper.php:63: * @todo Implement a filter for ease notification of other objects like the pool ./application/hub/classes/helper/dht/class_DhtBootstrapHelper.php:18: * @todo Find an interface for hub helper ./application/hub/classes/helper/dht/class_DhtPublishEntryHelper.php:18: * @todo Find an interface for hub helper ./application/hub/classes/helper/node/announcement/class_NodeAnnouncementHelper.php:17: * @todo Find an interface for hub helper @@ -111,32 +113,29 @@ ./application/hub/classes/helper/node/requests/class_NodeRequestNodeListHelper.php:17: * @todo Find an interface for hub helper ./application/hub/classes/helper/work_units/cruncher/class_CruncherTestUnitHelper.php:53: * @todo 0% done ./application/hub/classes/helper/work_units/cruncher/class_CruncherTestUnitHelper.php:64: * @todo 0% done -./application/hub/classes/iterator/network/class_NetworkListenIterator.php:16: * @todo This current implementation is not recommended, use a -./application/hub/classes/iterator/network/class_NetworkListenIterator.php:17: * @todo latency-based iteration or similar approaches -./application/hub/classes/iterator/pool/handler/class_HandlerPoolIterator.php:16: * @todo This current implementation is not recommended, use a -./application/hub/classes/iterator/pool/handler/class_HandlerPoolIterator.php:17: * @todo latency-based iteration or similar approaches -./application/hub/classes/iterator/pool/monitor/class_MonitorPoolIterator.php:17: * @todo This current implementation is not recommended, use a -./application/hub/classes/iterator/pool/monitor/class_MonitorPoolIterator.php:18: * @todo latency-based iteration or similar approaches -./application/hub/classes/iterator/pool/tasks/class_TaskPoolIterator.php:17: * @todo This current implementation is not recommended, use a -./application/hub/classes/iterator/pool/tasks/class_TaskPoolIterator.php:18: * @todo latency-based iteration or similar approaches -./application/hub/classes/listener/class_BaseListener.php:340: // @TODO On some systems it is 134, on some 107? -./application/hub/classes/listener/class_BaseListener.php:437: // @TODO Does this work on Windozer boxes??? -./application/hub/classes/listener/tcp/class_TcpListener.php:67: * @todo Needs rewrite! -./application/hub/classes/listener/udp/class_UdpListener.php:156: * @todo ~50% done -./application/hub/classes/listener/udp/class_UdpListener.php:63: * @todo Needs rewrite! +./application/hub/classes/iterator/network/class_NetworkListenIterator.php:20: * @todo This current implementation is not recommended, use a +./application/hub/classes/iterator/network/class_NetworkListenIterator.php:21: * @todo latency-based iteration or similar approaches +./application/hub/classes/iterator/pool/handler/class_HandlerPoolIterator.php:20: * @todo This current implementation is not recommended, use a +./application/hub/classes/iterator/pool/handler/class_HandlerPoolIterator.php:21: * @todo latency-based iteration or similar approaches +./application/hub/classes/iterator/pool/monitor/class_MonitorPoolIterator.php:21: * @todo This current implementation is not recommended, use a +./application/hub/classes/iterator/pool/monitor/class_MonitorPoolIterator.php:22: * @todo latency-based iteration or similar approaches +./application/hub/classes/iterator/pool/tasks/class_TaskPoolIterator.php:20: * @todo This current implementation is not recommended, use a +./application/hub/classes/iterator/pool/tasks/class_TaskPoolIterator.php:21: * @todo latency-based iteration or similar approaches +./application/hub/classes/listener/class_BaseListener.php:311: // @TODO Does this work on Windozer boxes??? +./application/hub/classes/listener/udp/class_UdpListener.php:89: * @todo ~50% done ./application/hub/classes/miner/chash/class_HubCoinMiner.php:107: // @TODO Implement this method ./application/hub/classes/miner/chash/class_HubCoinMiner.php:117: * @todo Implement this method ./application/hub/classes/miner/chash/class_HubCoinMiner.php:147: * @todo 0% done -./application/hub/classes/miner/class_BaseHubMiner.php:225: * @todo Try to make this method more generic so we can move it in BaseFrameworkSystem +./application/hub/classes/miner/class_BaseHubMiner.php:224: * @todo Try to make this method more generic so we can move it in BaseFrameworkSystem ./application/hub/classes/nodes/boot/class_HubBootNode.php:127: // @TODO Add some filters here ./application/hub/classes/nodes/boot/class_HubBootNode.php:69: * @todo add some more special bootstrap things for this boot node -./application/hub/classes/nodes/class_BaseHubNode.php:160: * @todo Make this code more generic and move it to CryptoHelper or -./application/hub/classes/nodes/class_BaseHubNode.php:421: * @todo Try to make this method more generic so we can move it in BaseFrameworkSystem -./application/hub/classes/nodes/class_BaseHubNode.php:461: * @todo Change the first if() block to check for a specific state -./application/hub/classes/nodes/class_BaseHubNode.php:679: * @todo Add checking if this node has been announced to the sender node -./application/hub/classes/nodes/class_BaseHubNode.php:699: * @todo Add checking if this node has been announced to the sender node -./application/hub/classes/nodes/class_BaseHubNode.php:804: * @todo Find more to do here -./application/hub/classes/nodes/class_BaseHubNode.php:817: * @todo Handle thrown exception +./application/hub/classes/nodes/class_BaseHubNode.php:159: * @todo Make this code more generic and move it to CryptoHelper or +./application/hub/classes/nodes/class_BaseHubNode.php:420: * @todo Try to make this method more generic so we can move it in BaseFrameworkSystem +./application/hub/classes/nodes/class_BaseHubNode.php:460: * @todo Change the first if() block to check for a specific state +./application/hub/classes/nodes/class_BaseHubNode.php:678: * @todo Add checking if this node has been announced to the sender node +./application/hub/classes/nodes/class_BaseHubNode.php:698: * @todo Add checking if this node has been announced to the sender node +./application/hub/classes/nodes/class_BaseHubNode.php:780: * @todo Find more to do here +./application/hub/classes/nodes/class_BaseHubNode.php:793: * @todo Handle thrown exception ./application/hub/classes/nodes/list/class_HubListNode.php:68: * @todo Implement more bootstrap steps ./application/hub/classes/nodes/list/class_HubListNode.php:89: // @TODO Add some filters here ./application/hub/classes/nodes/list/class_HubListNode.php:98: * @todo 0% done @@ -146,15 +145,15 @@ ./application/hub/classes/nodes/regular/class_HubRegularNode.php:68: * @todo Implement this method ./application/hub/classes/nodes/regular/class_HubRegularNode.php:89: // @TODO Add some filters here ./application/hub/classes/nodes/regular/class_HubRegularNode.php:98: * @todo 0% done -./application/hub/classes/package/class_NetworkPackage.php:1296: * @todo This may be enchanced for outgoing packages? -./application/hub/classes/package/class_NetworkPackage.php:1414: * @todo Implement verification of all sent tags here? -./application/hub/classes/package/class_NetworkPackage.php:1491: * @todo ~10% done? -./application/hub/classes/package/class_NetworkPackage.php:1533: $this->partialStub('@TODO nodeId=' . $nodeId . ',messageData=' . print_r($messageData, TRUE)); -./application/hub/classes/package/class_NetworkPackage.php:434: // @TODO md5() is very weak, but it needs to be fast -./application/hub/classes/package/class_NetworkPackage.php:508: // @TODO md5() is very weak, but it needs to be fast -./application/hub/classes/package/class_NetworkPackage.php:51: * @todo Needs to add functionality for handling the object's type -./application/hub/classes/package/class_NetworkPackage.php:691: // @TODO We may want to do somthing more here? -./application/hub/classes/package/class_NetworkPackage.php:741: * @todo Unfinished area, hashes are currently NOT fully supported +./application/hub/classes/package/class_NetworkPackage.php:1299: * @todo This may be enchanced for outgoing packages? +./application/hub/classes/package/class_NetworkPackage.php:1417: * @todo Implement verification of all sent tags here? +./application/hub/classes/package/class_NetworkPackage.php:1494: * @todo ~10% done? +./application/hub/classes/package/class_NetworkPackage.php:1536: $this->partialStub('@TODO nodeId=' . $nodeId . ',messageData=' . print_r($messageData, TRUE)); +./application/hub/classes/package/class_NetworkPackage.php:437: // @TODO md5() is very weak, but it needs to be fast +./application/hub/classes/package/class_NetworkPackage.php:511: // @TODO md5() is very weak, but it needs to be fast +./application/hub/classes/package/class_NetworkPackage.php:54: * @todo Needs to add functionality for handling the object's type +./application/hub/classes/package/class_NetworkPackage.php:697: // @TODO We may want to do somthing more here? +./application/hub/classes/package/class_NetworkPackage.php:747: * @todo Unfinished area, hashes are currently NOT fully supported ./application/hub/classes/package/fragmenter/class_PackageFragmenter.php:287: * @todo Implement a way to send non-announcement packages with extra-salt ./application/hub/classes/package/fragmenter/class_PackageFragmenter.php:382: // @TODO This assert broke packages where the hash chunk was very large: assert(strlen($rawData) <= NetworkPackage::TCP_PACKAGE_SIZE); ./application/hub/classes/package/fragmenter/class_PackageFragmenter.php:453: * @todo $helperInstance is unused @@ -299,31 +298,32 @@ ./application/hub/classes/visitor/pool/monitor/class_RawDataPoolMonitorVisitor.php:68: * @todo Maybe throw UnsupportedOperationException? ./application/hub/config.php:766:// @TODO This and the next value is very static again ./application/hub/config.php:827:// @TODO This is very static, rewrite it to more flexible -./application/hub/interfaces/apt-proxy/class_AptProxy.php:18: * @todo We need to find a better name for this interface +./application/hub/interfaces/apt-proxy/class_AptProxy.php:20: * @todo We need to find a better name for this interface ./application/hub/interfaces/blocks/class_Minable.php:16: * @todo We need to find a better name for this interface -./application/hub/interfaces/chat/class_Chatter.php:18: * @todo We need to find a better name for this interface -./application/hub/interfaces/crawler/class_Crawler.php:19: * @todo We need to find a better name for this interface -./application/hub/interfaces/cruncher/class_CruncherHelper.php:18: * @todo We need to find a better name for this interface +./application/hub/interfaces/chat/class_Chatter.php:20: * @todo We need to find a better name for this interface +./application/hub/interfaces/class_HubInterface.php:18: * @todo Find a better name for this interface +./application/hub/interfaces/crawler/class_Crawler.php:21: * @todo We need to find a better name for this interface +./application/hub/interfaces/cruncher/class_CruncherHelper.php:20: * @todo We need to find a better name for this interface ./application/hub/interfaces/database/frontend/class_NodeDhtWrapper.php:130: * @todo Add minimum/maximum age limitations ./application/hub/interfaces/database/frontend/class_NodeDhtWrapper.php:140: * @todo Add timestamp to dataset instance ./application/hub/interfaces/helper/connections/class_ConnectionHelper.php:16: * @todo Please find another name for this interface ./application/hub/interfaces/helper/connections/class_ConnectionHelper.php:44: * @todo We may want to implement a filter for ease notification of other objects like our pool ./application/hub/interfaces/helper/messages/class_MessageHelper.php:16: * @todo Please find another name for this interface ./application/hub/interfaces/helper/nodes/class_NodeHelper.php:24: * @todo We need to find a better name for this interface -./application/hub/interfaces/miner/class_MinerHelper.php:18: * @todo We need to find a better name for this interface +./application/hub/interfaces/miner/class_MinerHelper.php:20: * @todo We need to find a better name for this interface ./core/application/tests/class_ApplicationHelper.php:273: * @todo Nothing to add? ./core/framework/config/class_FrameworkConfiguration.php:127: * @todo This method encapsulates a deprecated PHP function and should be deprecated, too. ./core/framework/config/class_FrameworkConfiguration.php:252: * @todo Have to check some more entries from $_SERVER here ./core/framework/loader/class_ClassLoader.php:232: // @TODO Throw exception instead of break ./core/framework/loader/class_ClassLoader.php:423: /* @TODO: Do not exit here. */ ./core/framework/main/classes/cache/class_MemoryCache.php:17: * @todo Rename to InProgressCache -./core/framework/main/classes/class_BaseFrameworkSystem.php:2090: // @TODO Move the constant to e.g. BaseDatabaseResult when there is a non-cached database result available -./core/framework/main/classes/class_BaseFrameworkSystem.php:2205: * @todo Write a logging mechanism for productive mode -./core/framework/main/classes/class_BaseFrameworkSystem.php:2220: // @TODO Finish this part! -./core/framework/main/classes/class_BaseFrameworkSystem.php:3206: * @todo Improve documentation -./core/framework/main/classes/class_BaseFrameworkSystem.php:338: // @todo Try to clean these constants up -./core/framework/main/classes/class_BaseFrameworkSystem.php:584: // @TODO __CLASS__ does always return BaseFrameworkSystem but not the extending (=child) class -./core/framework/main/classes/class_BaseFrameworkSystem.php:688: * @todo SearchableResult and UpdateableResult shall have a super interface to use here +./core/framework/main/classes/class_BaseFrameworkSystem.php:2067: // @TODO Move the constant to e.g. BaseDatabaseResult when there is a non-cached database result available +./core/framework/main/classes/class_BaseFrameworkSystem.php:2182: * @todo Write a logging mechanism for productive mode +./core/framework/main/classes/class_BaseFrameworkSystem.php:2197: // @TODO Finish this part! +./core/framework/main/classes/class_BaseFrameworkSystem.php:3183: * @todo Improve documentation +./core/framework/main/classes/class_BaseFrameworkSystem.php:333: // @todo Try to clean these constants up +./core/framework/main/classes/class_BaseFrameworkSystem.php:578: // @TODO __CLASS__ does always return BaseFrameworkSystem but not the extending (=child) class +./core/framework/main/classes/class_BaseFrameworkSystem.php:682: * @todo SearchableResult and UpdateableResult shall have a super interface to use here ./core/framework/main/classes/commands/console/class_ConsoleFuseCommand.php:83: // @TODO Unfinished ./core/framework/main/classes/commands/html/class_HtmlLoginAreaCommand.php:78: * @todo Add some stuff here: Some personal data, app/game related data ./core/framework/main/classes/commands/html/class_HtmlProblemCommand.php:70: * @todo 0% done @@ -389,7 +389,7 @@ ./core/framework/main/classes/images/class_BaseImage.php:268: * @todo Find something usefull for this method. ./core/framework/main/classes/images/class_BaseImage.php:278: * @todo Find something usefull for this method. ./core/framework/main/classes/index/class_BaseIndex.php:160: * @todo Currently the index file is not cached, please implement a memory-handling class and if enough RAM is found, cache the whole index file. -./core/framework/main/classes/lists/class_BaseList.php:321: // @TODO Extend this somehow? +./core/framework/main/classes/lists/class_BaseList.php:315: // @TODO Extend this somehow? ./core/framework/main/classes/lists/groups/class_ListGroupList.php:68: * @todo 0% done ./core/framework/main/classes/mailer/debug/class_DebugMailer.php:137: * @todo 0% done ./core/framework/main/classes/menu/class_BaseMenu.php:75: // Log exception @TODO Maybe to intrusive? @@ -465,7 +465,7 @@ ./core/index.php:58: * @todo This method is old code and needs heavy rewrite and should be moved to ApplicationHelper ./index.php:58: * @todo This method is old code and needs heavy rewrite and should be moved to ApplicationHelper ### ### DEPRECATION FOLLOWS: ### ### -./application/hub/classes/nodes/class_BaseHubNode.php:72: * @deprecated +./application/hub/classes/nodes/class_BaseHubNode.php:71: * @deprecated ./application/hub/data.php:2:// @DEPRECATED ./application/hub/exceptions/state/class_UnexpectedStateException.php:2:// @DEPRECATED ./application/hub/init.php:2:// @DEPRECATED @@ -481,7 +481,7 @@ ./core/framework/database/lib-lfdb.php:2:// @DEPRECATED ./core/framework/database.php:2:// @DEPRECATED ./core/framework/includes.php:2:// @DEPRECATED -./core/framework/main/classes/class_BaseFrameworkSystem.php:1839: * @deprecated Not fully, as the new Logger facilities are not finished yet. +./core/framework/main/classes/class_BaseFrameworkSystem.php:1816: * @deprecated Not fully, as the new Logger facilities are not finished yet. ./core/framework/main/exceptions/base64/class_Base64EncodingBadException.php:17: * @deprecated Don't use this anymore ./core/framework/main/exceptions/base64/class_Base64EncodingModuloException.php:16: * @deprecated Don't use this anymore ./core/framework/main/exceptions/crypto/class_EncryptInvalidLengthException.php:17: * @deprecated Don't use this anymore