From: Roland Häder Date: Thu, 16 Feb 2012 23:32:18 +0000 (+0000) Subject: Development (again) continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3967f4e37b70e307f0f6292dafffa84a038bb6b1;p=hub.git Development (again) continued: - New interface 'HandleableChunks introduced - Task for chunk assembler/handler added, still some required methods are not yet added (unfinished) - Changed interfaces in some setter to more generic to allow more object instances being set (which are still fine) - Moved initialization of e.g. network package instance in task classes to factory method to speed-up things in executeTask() method - TODOs.txt updated --- diff --git a/.gitattributes b/.gitattributes index aba2aab57..5c678d178 100644 --- a/.gitattributes +++ b/.gitattributes @@ -46,6 +46,8 @@ application/hub/interfaces/discovery/class_DiscoverableSocket.php svneol=native# application/hub/interfaces/executor/.htaccess svneol=native#text/plain application/hub/interfaces/executor/class_Executor.php svneol=native#text/plain application/hub/interfaces/handler/.htaccess -text svneol=unset#text/plain +application/hub/interfaces/handler/chunks/.htaccess -text svneol=unset#text/plain +application/hub/interfaces/handler/chunks/class_HandleableChunks.php svneol=native#text/plain application/hub/interfaces/handler/class_Handleable.php svneol=native#text/plain application/hub/interfaces/handler/network/.htaccess -text svneol=unset#text/plain application/hub/interfaces/handler/network/class_Networkable.php svneol=native#text/plain @@ -533,6 +535,9 @@ application/hub/main/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php svneol application/hub/main/tasks/hub/.htaccess -text svneol=unset#text/plain application/hub/main/tasks/hub/announcement/.htaccess -text svneol=unset#text/plain application/hub/main/tasks/hub/announcement/class_HubSelfAnnouncementTask.php svneol=native#text/plain +application/hub/main/tasks/hub/chunks/.htaccess -text svneol=unset#text/plain +application/hub/main/tasks/hub/chunks/class_HubChunkAssemblerTask.php svneol=native#text/plain +application/hub/main/tasks/hub/class_Hub svneol=native#text/plain application/hub/main/tasks/hub/class_HubSelfConnectTask.php svneol=native#text/plain application/hub/main/tasks/hub/ping/.htaccess -text svneol=unset#text/plain application/hub/main/tasks/hub/ping/class_HubPingTask.php svneol=native#text/plain diff --git a/application/hub/config.php b/application/hub/config.php index 4c60d5ea9..fc996d7e3 100644 --- a/application/hub/config.php +++ b/application/hub/config.php @@ -270,6 +270,15 @@ $cfg->setConfigEntry('stacker_package_declared_max_size', 1000); // CFG: STACKER-PACKAGE-OUTGOING-MAX-SIZE $cfg->setConfigEntry('stacker_package_outgoing_max_size', 100); +// CFG: STACKER-PACKAGE-DECODED-DATA-MAX-SIZE +$cfg->setConfigEntry('stacker_package_decoded_data_max_size', 200); + +// CFG: STACKER-PACKAGE-HANDLED-DECODED-MAX-SIZE +$cfg->setConfigEntry('stacker_package_handled_decoded_max_size', 200); + +// CFG: STACKER-PACKAGE-CHUNKED-DECODED-MAX-SIZE +$cfg->setConfigEntry('stacker_package_chunked_decoded_max_size', 800); + // CFG: STACKER-PACKAGE-BACKBUFFER-MAX-SIZE $cfg->setConfigEntry('stacker_package_backbuffer_max_size', 1000); @@ -291,12 +300,6 @@ $cfg->setConfigEntry('stacker_incoming_queue_max_size', 100000); // CFG: STACKER-DECODED-DATA-MAX-SIZE $cfg->setConfigEntry('stacker_decoded_data_max_size', 100); -// CFG: STACKER-PACKAGE-DECODED-DATA-MAX-SIZE -$cfg->setConfigEntry('stacker_package_decoded_data_max_size', 200); - -// CFG: STACKER-PACKAGE-HANDLED-DECODED-MAX-SIZE -$cfg->setConfigEntry('stacker_package_handled_decoded_max_size', 200); - // CFG: STACKER-FINAL-CHUNKS-MAX-SIZE $cfg->setConfigEntry('stacker_final_chunks_max_size', 100); @@ -393,6 +396,9 @@ $cfg->setConfigEntry('hub_package_reader_task_class', 'NetworkPackageReaderTask' // CFG: HUB-SOCKET-LISTENER-TASK-CLASS $cfg->setConfigEntry('hub_socket_listener_task_class', 'HubSocketListenerTask'); +// CFG: HUB-CHUNK-ASSEMBLER-TASK-CLASS +$cfg->setConfigEntry('hub_chunk_assembler_task_class', 'HubChunkAssemblerTask'); + // CFG: TASK-NETWORK-PACKAGE-WRITER-STARTUP-DELAY $cfg->setConfigEntry('task_network_package_writer_startup_delay', 2500); @@ -420,6 +426,15 @@ $cfg->setConfigEntry('task_socket_listener_interval_delay', 10); // CFG: TASK-SOCKET-LISTENER-MAX-RUNS $cfg->setConfigEntry('task_socket_listener_max_runs', 0); +// CFG: TASK-CHUNK-ASSEMBLER-STATUP-DELAY +$cfg->setConfigEntry('task_chunk_assembler_startup_delay', 1500); + +// CFG: TASK-CHUNK-ASSEMBLER-INTERVAL-DELAY +$cfg->setConfigEntry('task_chunk_assembler_interval_delay', 10); + +// CFG: TASK-CHUNK-ASSEMBLER-MAX-RUNS +$cfg->setConfigEntry('task_chunk_assembler_max_runs', 0); + // CFG: TASK-LIST-CLASS $cfg->setConfigEntry('task_list_class', 'TaskList'); diff --git a/application/hub/interfaces/handler/chunks/.htaccess b/application/hub/interfaces/handler/chunks/.htaccess new file mode 100644 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/interfaces/handler/chunks/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/hub/interfaces/handler/chunks/class_HandleableChunks.php b/application/hub/interfaces/handler/chunks/class_HandleableChunks.php new file mode 100644 index 000000000..253e8b584 --- /dev/null +++ b/application/hub/interfaces/handler/chunks/class_HandleableChunks.php @@ -0,0 +1,36 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +interface HandleableChunks extends Handleable { + /** + * Adds all chunks if the last one verifies as a 'final chunk'. + * + * @param $chunks An array with chunks, the last one should be a 'final' + * @return void + * @throws FinalChunkVerificationException If the final chunk does not start with 'EOP:' + */ + function addAllChunksWithFinal (array $chunks); +} + +// [EOF] +?> diff --git a/application/hub/main/class_BaseHubSystem.php b/application/hub/main/class_BaseHubSystem.php index 10f5cc3df..fd0d4ad7b 100644 --- a/application/hub/main/class_BaseHubSystem.php +++ b/application/hub/main/class_BaseHubSystem.php @@ -136,10 +136,10 @@ class BaseHubSystem extends BaseFrameworkSystem { /** * Setter for network package handler instance * - * @param $packageInstance The network package handler instance we shall set + * @param $packageInstance The network package instance we shall set * @return void */ - protected final function setPackageInstance (Networkable $packageInstance) { + protected final function setPackageInstance (Deliverable $packageInstance) { $this->packageInstance = $packageInstance; } diff --git a/application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php b/application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php index 620135ba8..a64280ca4 100644 --- a/application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php +++ b/application/hub/main/filter/task/node/class_NodeTaskHandlerInitializerFilter.php @@ -79,6 +79,12 @@ class NodeTaskHandlerInitializerFilter extends BaseFilter implements Filterable // Register it as well $handlerInstance->registerTask('network_package_writer', $taskInstance); + // Generate chunk assembler task + $taskInstance = ObjectFactory::createObjectByConfiguredName('hub_chunk_assembler_task_class'); + + // Register it as well + $handlerInstance->registerTask('chunk_assembler', $taskInstance); + // Query handler instance $handlerInstance->registerTask('query_handler', $nodeInstance->getQueryConnectorInstance()); diff --git a/application/hub/main/handler/chunks/class_ChunkHandler.php b/application/hub/main/handler/chunks/class_ChunkHandler.php index ea5865ab8..a6826670b 100644 --- a/application/hub/main/handler/chunks/class_ChunkHandler.php +++ b/application/hub/main/handler/chunks/class_ChunkHandler.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class ChunkHandler extends BaseHandler implements Registerable { +class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable { /** * Stacker for chunks with final EOP */ @@ -38,15 +38,6 @@ class ChunkHandler extends BaseHandler implements Registerable { // Set handler name $this->setHandlerName('chunk'); - - // Get a FIFO stacker - $stackerInstance = ObjectFactory::createObjectByConfiguredName('chunk_handler_stacker_class'); - - // Init all stacker - $stackerInstance->initStacker(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP); - - // Set the stacker in this handler - $this->setStackerInstance($stackerInstance); } /** @@ -58,6 +49,15 @@ class ChunkHandler extends BaseHandler implements Registerable { // Get new instance $handlerInstance = new ChunkHandler(); + // Get a FIFO stacker + $stackerInstance = ObjectFactory::createObjectByConfiguredName('chunk_handler_stacker_class'); + + // Init all stacker + $stackerInstance->initStacker(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP); + + // Set the stacker in this handler + $handlerInstance->setStackerInstance($stackerInstance); + // Return the prepared instance return $handlerInstance; } @@ -82,6 +82,19 @@ class ChunkHandler extends BaseHandler implements Registerable { $this->getStackerInstance()->pushNamed(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP, $chunk); } // END - foreach } + + /** + * Checks whether unhandled chunks are available + * + * @return $unhandledChunks Whether unhandled chunks are left + */ + public function ifUnhandledChunksAvailable () { + // Simply check if the stacker is not empty + $unhandledChunks = $this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_CHUNKS_WITH_FINAL_EOP) === false; + + // Return result + return $unhandledChunks; + } } // [EOF] diff --git a/application/hub/main/handler/class_ b/application/hub/main/handler/class_ index e268407c6..ddef1e2d1 100644 --- a/application/hub/main/handler/class_ +++ b/application/hub/main/handler/class_ @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class ???Handler extends BaseHandler { +class ???Handler extends BaseHandler implements Handleable { /** * Protected constructor * diff --git a/application/hub/main/package/class_NetworkPackage.php b/application/hub/main/package/class_NetworkPackage.php index 37c36f19a..0c28f7fc2 100644 --- a/application/hub/main/package/class_NetworkPackage.php +++ b/application/hub/main/package/class_NetworkPackage.php @@ -121,6 +121,11 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Receiva */ const STACKER_NAME_DECODED_HANDLED = 'package_handled_decoded'; + /** + * Stacker name for "chunked" decoded raw data + */ + const STACKER_NAME_DECODED_CHUNKED = 'package_chunked_decoded'; + /** * Stacker name for "back-buffered" packages */ @@ -190,9 +195,10 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Receiva /** * Initialize all stackers * + * @param $forceReInit Whether to force reinitialization of all stacks * @return void */ - protected function initStackers () { + protected function initStackers ($forceReInit = false) { // Initialize all foreach ( array( @@ -201,10 +207,11 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Receiva self::STACKER_NAME_OUTGOING, self::STACKER_NAME_DECODED_INCOMING, self::STACKER_NAME_DECODED_HANDLED, + self::STACKER_NAME_DECODED_CHUNKED, self::STACKER_NAME_BACK_BUFFER ) as $stackerName) { // Init this stacker - $this->getStackerInstance()->initStacker($stackerName); + $this->getStackerInstance()->initStacker($stackerName, $forceReInit); } // END - foreach } @@ -699,12 +706,17 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Receiva // Get current package content (an array with two elements; see handleIncomingDecodedData() for details) $packageContent = $this->getStackerInstance()->getNamed(self::STACKER_NAME_DECODED_HANDLED); - // Get a package assembler instance from factory + // Get a singleton package assembler instance from factory $assemblerInstance = PackageAssemblerFactory::createAssemblerInstance(); // Start assembling the raw package data array by chunking it $assemblerInstance->chunkPackageContent($packageContent); - die(__METHOD__.': BACK!' . chr(10)); + + // Remove the package from 'handled_decoded' stack ... + $this->getStackerInstance()->popNamed(self::STACKER_NAME_DECODED_HANDLED); + + // ... and push it on the 'chunked' stacker + $this->getStackerInstance()->pushNamed(self::STACKER_NAME_DECODED_CHUNKED, $packageContent); } /** @@ -739,19 +751,8 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Receiva * @return void */ public function clearAllStacker () { - // Do the cleanup (no flushing) - foreach ( - array( - self::STACKER_NAME_UNDECLARED, - self::STACKER_NAME_DECLARED, - self::STACKER_NAME_OUTGOING, - self::STACKER_NAME_DECODED_INCOMING, - self::STACKER_NAME_DECODED_HANDLED, - self::STACKER_NAME_BACK_BUFFER - ) as $stackerName) { - // Clear this stacker by forcing an init - $this->getStackerInstance()->initStacker($stackerName, true); - } // END - foreach + // Call the init method to force re-initialization + $this->initStackers(true); // Debug message /* DEBUG: */ $this->debugOutput('PACKAGE: All stacker have been re-initialized.'); diff --git a/application/hub/main/tasks/hub/chunks/.htaccess b/application/hub/main/tasks/hub/chunks/.htaccess new file mode 100644 index 000000000..3a4288278 --- /dev/null +++ b/application/hub/main/tasks/hub/chunks/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/hub/main/tasks/hub/chunks/class_HubChunkAssemblerTask.php b/application/hub/main/tasks/hub/chunks/class_HubChunkAssemblerTask.php new file mode 100644 index 000000000..cc2c5d753 --- /dev/null +++ b/application/hub/main/tasks/hub/chunks/class_HubChunkAssemblerTask.php @@ -0,0 +1,81 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class HubChunkAssemblerTask extends BaseTask implements Taskable, Visitable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $taskInstance An instance of a Visitable class + */ + public final static function createHubChunkAssemblerTask () { + // Get new instance + $taskInstance = new HubChunkAssemblerTask(); + + // Get a chunk handler instance + $handlerInstance = ChunkHandlerFactory::createChunkHandlerInstance(); + + // And add it to this task instance + $taskInstance->setHandlerInstance($handlerInstance); + + // Return the prepared instance + return $taskInstance; + } + + /** + * Accepts the visitor to process the visit "request" + * + * @param $visitorInstance An instance of a Visitor class + * @return void + * @todo Also visit some sub-objects? + */ + public function accept (Visitor $visitorInstance) { + // Visit this task + $visitorInstance->visitTask($this); + } + + /** + * Executes the task + * + * @return void + */ + public function executeTask () { + // Are there chunks to handle? + if ($this->getHandlerInstance()->ifUnhandledChunksAvailable()) { + // Then handle them (not all!) + $this->getHandlerInstance()->handleAvailableChunks(); + } // END - if + } +} + +// [EOF] +?> diff --git a/application/hub/main/tasks/hub/class_Hub b/application/hub/main/tasks/hub/class_Hub new file mode 100644 index 000000000..f435e52f9 --- /dev/null +++ b/application/hub/main/tasks/hub/class_Hub @@ -0,0 +1,72 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class Hub???Task extends BaseTask implements Taskable, Visitable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this class + * + * @return $taskInstance An instance of a Visitable class + */ + public final static function createHub???Task () { + // Get new instance + $taskInstance = new Hub???Task(); + + // Return the prepared instance + return $taskInstance; + } + + /** + * Accepts the visitor to process the visit "request" + * + * @param $visitorInstance An instance of a Visitor class + * @return void + * @todo Maybe visit some sub-objects + */ + public function accept (Visitor $visitorInstance) { + // Visit this task + $visitorInstance->visitTask($this); + } + + /** + * Executes the task + * + * @return void + * @todo 0% + */ + public function executeTask () { + $this->partialStub('Unimplemented task.'); + } +} + +// [EOF] +?> diff --git a/application/hub/main/tasks/hub/ping/class_HubPingTask.php b/application/hub/main/tasks/hub/ping/class_HubPingTask.php index d63c04f05..272617a20 100644 --- a/application/hub/main/tasks/hub/ping/class_HubPingTask.php +++ b/application/hub/main/tasks/hub/ping/class_HubPingTask.php @@ -60,6 +60,7 @@ class HubPingTask extends BaseTask implements Taskable, Visitable { * * @param $visitorInstance An instance of a Visitor class * @return void + * @todo Also visit some sub-objects? */ public function accept (Visitor $visitorInstance) { // Visit this task diff --git a/application/hub/main/tasks/network/class_NetworkPackageReaderTask.php b/application/hub/main/tasks/network/class_NetworkPackageReaderTask.php index fc7d85168..7e10c0e84 100644 --- a/application/hub/main/tasks/network/class_NetworkPackageReaderTask.php +++ b/application/hub/main/tasks/network/class_NetworkPackageReaderTask.php @@ -45,6 +45,12 @@ class NetworkPackageReaderTask extends BaseTask implements Taskable, Visitable { // Set the listener instance here $taskInstance->setListenerPoolInstance($poolInstance); + // Get a singleton network package instance + $packageInstance = NetworkPackageFactory::createNetworkPackageInstance(); + + // And set it in this task + $taskInstance->setPackageInstance($packageInstance); + // Return the prepared instance return $taskInstance; } @@ -54,6 +60,7 @@ class NetworkPackageReaderTask extends BaseTask implements Taskable, Visitable { * * @param $visitorInstance An instance of a Visitor class * @return void + * @todo Also visit some sub-objects? */ public function accept (Visitor $visitorInstance) { // Visit this task @@ -66,23 +73,20 @@ class NetworkPackageReaderTask extends BaseTask implements Taskable, Visitable { * @return void */ public function executeTask () { - // Get a singleton network package instance - $packageInstance = NetworkPackageFactory::createNetworkPackageInstance(); - // Do we have something to handle? - if ($packageInstance->isNewRawDataPending($this->getListenerPoolInstance())) { + if ($this->getPackageInstance()->isNewRawDataPending($this->getListenerPoolInstance())) { // We have to handle raw data from the socket - $packageInstance->handleIncomingDecodedData(); - } elseif ($packageInstance->isIncomingDecodedDataHandled()) { + $this->getPackageInstance()->handleIncomingDecodedData(); + } elseif ($this->getPackageInstance()->isIncomingDecodedDataHandled()) { /* * We have handled decoded data so we should validate it, if we have * all chunks/fragments together, and assemble it into an abstract * network package. */ - $packageInstance->assembleDecodedDataToPackage(); - } elseif ($packageInstance->isNewPackageArrived()) { + $this->getPackageInstance()->assembleDecodedDataToPackage(); + } elseif ($this->getPackageInstance()->isNewPackageArrived()) { // Okay, then handle newly arrived package - $packageInstance->handleNewlyArrivedPackage(); + $this->getPackageInstance()->handleNewlyArrivedPackage(); } // END - if } } diff --git a/application/hub/main/tasks/network/class_NetworkPackageWriterTask.php b/application/hub/main/tasks/network/class_NetworkPackageWriterTask.php index 39874dedd..12cbd092d 100644 --- a/application/hub/main/tasks/network/class_NetworkPackageWriterTask.php +++ b/application/hub/main/tasks/network/class_NetworkPackageWriterTask.php @@ -41,6 +41,12 @@ class NetworkPackageWriterTask extends BaseTask implements Taskable, Visitable { // Get new instance $taskInstance = new NetworkPackageWriterTask(); + // Get a singleton network package instance + $packageInstance = NetworkPackageFactory::createNetworkPackageInstance(); + + // And set it in this task + $taskInstance->setPackageInstance($packageInstance); + // Return the prepared instance return $taskInstance; } @@ -50,6 +56,7 @@ class NetworkPackageWriterTask extends BaseTask implements Taskable, Visitable { * * @param $visitorInstance An instance of a Visitor class * @return void + * @todo Also visit some sub-objects? */ public function accept (Visitor $visitorInstance) { // Visit this task @@ -62,19 +69,16 @@ class NetworkPackageWriterTask extends BaseTask implements Taskable, Visitable { * @return void */ public function executeTask () { - // Get a singleton network package instance - $packageInstance = NetworkPackageFactory::createNetworkPackageInstance(); - // Do we have something to deliver? - if ($packageInstance->isPackageEnqueued()) { + if ($this->getPackageInstance()->isPackageEnqueued()) { // Okay, then deliver (better discover its recipients) this package - $packageInstance->declareEnqueuedPackage(); - } elseif ($packageInstance->isPackageDeclared()) { + $this->getPackageInstance()->declareEnqueuedPackage(); + } elseif ($this->getPackageInstance()->isPackageDeclared()) { // Prepare package for delivery - $packageInstance->deliverDeclaredPackage(); - } elseif ($packageInstance->isPackageWaitingForDelivery()) { + $this->getPackageInstance()->deliverDeclaredPackage(); + } elseif ($this->getPackageInstance()->isPackageWaitingForDelivery()) { // Sent it finally out - $packageInstance->sendWaitingPackage(); + $this->getPackageInstance()->sendWaitingPackage(); } } } diff --git a/docs/TODOs.txt b/docs/TODOs.txt index ad5c9aab9..757301ad1 100644 --- a/docs/TODOs.txt +++ b/docs/TODOs.txt @@ -92,15 +92,15 @@ ./application/hub/main/nodes/regular/class_HubRegularNode.php:58: * @todo Implement this method ./application/hub/main/nodes/regular/class_HubRegularNode.php:68: * @todo Unfinished method ./application/hub/main/nodes/regular/class_HubRegularNode.php:91: // @TODO Add some filters here -./application/hub/main/package/class_NetworkPackage.php:218: * @todo $helperInstance is unused -./application/hub/main/package/class_NetworkPackage.php:222: // @TODO crc32() is very weak, but it needs to be fast +./application/hub/main/package/class_NetworkPackage.php:225: * @todo $helperInstance is unused +./application/hub/main/package/class_NetworkPackage.php:229: // @TODO crc32() is very weak, but it needs to be fast ./application/hub/main/package/class_NetworkPackage.php:23: * @todo Needs to add functionality for handling the object's type -./application/hub/main/package/class_NetworkPackage.php:386: // @TODO We may want to do somthing more here? -./application/hub/main/package/class_NetworkPackage.php:492: // @TODO Add some logging here -./application/hub/main/package/class_NetworkPackage.php:518: // @TODO Add some logging here -./application/hub/main/package/class_NetworkPackage.php:622: // @TODO Add some logging here -./application/hub/main/package/class_NetworkPackage.php:716: // @TODO Add some content here -./application/hub/main/package/class_NetworkPackage.php:766: * @todo This may be enchanced for outgoing packages? +./application/hub/main/package/class_NetworkPackage.php:393: // @TODO We may want to do somthing more here? +./application/hub/main/package/class_NetworkPackage.php:499: // @TODO Add some logging here +./application/hub/main/package/class_NetworkPackage.php:525: // @TODO Add some logging here +./application/hub/main/package/class_NetworkPackage.php:629: // @TODO Add some logging here +./application/hub/main/package/class_NetworkPackage.php:728: // @TODO Add some content here +./application/hub/main/package/class_NetworkPackage.php:767: * @todo This may be enchanced for outgoing packages? ./application/hub/main/package/fragmenter/class_PackageFragmenter.php:427: * @todo $helperInstance is unused ./application/hub/main/producer/cruncher/keys/class_CruncherKeyProducer.php:106: // @TODO Do something with it ./application/hub/main/producer/cruncher/keys/class_CruncherKeyProducer.php:62: * @todo Find something for init phase of this key producer @@ -118,11 +118,15 @@ ./application/hub/main/tasks/cruncher/class_CruncherTestUnitProducerTask.php:53: * @todo Maybe visit some sub-objects ./application/hub/main/tasks/cruncher/class_CruncherWorkUnitFetcherTask.php:54: * @todo Maybe visit some sub-objects ./application/hub/main/tasks/hub/announcement/class_HubSelfAnnouncementTask.php:53: * @todo 0% +./application/hub/main/tasks/hub/chunks/class_HubChunkAssemblerTask.php:59: * @todo Also visit some sub-objects? ./application/hub/main/tasks/hub/class_HubSelfConnectTask.php:53: * @todo 0% ./application/hub/main/tasks/hub/class_HubSocketListenerTask.php:63: // @TODO Do we need to visit this task? $visitorInstance->visitTask($this); ./application/hub/main/tasks/hub/class_HubSocketListenerTask.php:70: * @todo 0% done -./application/hub/main/tasks/hub/ping/class_HubPingTask.php:73: * @todo 0% done +./application/hub/main/tasks/hub/ping/class_HubPingTask.php:63: * @todo Also visit some sub-objects? +./application/hub/main/tasks/hub/ping/class_HubPingTask.php:74: * @todo 0% done ./application/hub/main/tasks/hub/update/class_HubUpdateCheckTask.php:53: * @todo 0% +./application/hub/main/tasks/network/class_NetworkPackageReaderTask.php:63: * @todo Also visit some sub-objects? +./application/hub/main/tasks/network/class_NetworkPackageWriterTask.php:59: * @todo Also visit some sub-objects? ./application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php:10: * @todo This template engine does not make use of setTemplateType() ./application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php:10: * @todo This template engine does not make use of setTemplateType() ./application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php:240: * @todo Find something useful with this!