// CFG: NODE-DHT-BOOTSTRAP-TASK-CLASS
$cfg->setConfigEntry('node_dht_bootstrap_task_class', 'NodeDhtBootstrapTask');
+// CFG: NODE-DHT-LATE-BOOTSTRAP-TASK-CLASS
+$cfg->setConfigEntry('node_dht_late_bootstrap_task_class', 'NodeDhtLateBootstrapTask');
+
// CFG: NODE-DHT-QUERY-TASK-CLASS
$cfg->setConfigEntry('node_dht_query_task_class', 'NodeDhtQueryTask');
$cfg->setConfigEntry('task_dht_init_max_runs', 1);
// CFG: TASK-DHT-BOOTSTRAP-STATUP-DELAY
-$cfg->setConfigEntry('task_dht_bootstrap_startup_delay', 100);
+$cfg->setConfigEntry('task_dht_bootstrap_startup_delay', 500);
// CFG: TASK-DHT-BOOTSTRAP-INTERVAL-DELAY
$cfg->setConfigEntry('task_dht_bootstrap_interval_delay', 3600000); // = 1 hour (won't matter anyway)
// CFG: TASK-DHT-BOOTSTRAP-MAX-RUNS
$cfg->setConfigEntry('task_dht_bootstrap_max_runs', 1);
+// CFG: TASK-DHT-LATE-BOOTSTRAP-STATUP-DELAY
+$cfg->setConfigEntry('task_dht_late_bootstrap_startup_delay', 100);
+
+// CFG: TASK-DHT-LATE-BOOTSTRAP-INTERVAL-DELAY
+$cfg->setConfigEntry('task_dht_late_bootstrap_interval_delay', 3600000); // = 1 hour (won't matter anyway)
+
+// CFG: TASK-DHT-LATE-BOOTSTRAP-MAX-RUNS
+$cfg->setConfigEntry('task_dht_late_bootstrap_max_runs', 1);
+
// CFG: TASK-DHT-QUERY-STATUP-DELAY
$cfg->setConfigEntry('task_dht_query_startup_delay', 1400);
$handlerInstance = Registry::getRegistry()->getInstance('task_handler');
// Generate DHT bootstrap task
- $taskInstance = ObjectFactory::createObjectByConfiguredName('node_dht_bootstrap_task_class');
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('node_dht_late_bootstrap_task_class');
// Register it as well
- $handlerInstance->registerTask('dht_bootstrap', $taskInstance);
+ $handlerInstance->registerTask('dht_late_bootstrap', $taskInstance);
// Get the node instance
$nodeInstance = NodeObjectFactory::createNodeInstance();
+++ /dev/null
-Deny from all
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php
-/**
- * A Bootstrap task for DHTs, use this only for nodes which do not announce
- * themself to upper nodes as if they completed announcement they will attempt
- * to bootstrap their DHT. This said condition currently only matches with
- * bootstrap nodes (mode=boot) as they don't announce as they are already the
- * bootstrapper and there are no super nodes.
- *
- * If there would be super nodes, a centralization occurs (on the super nodes).
- *
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 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 <http://www.gnu.org/licenses/>.
- */
-class DhtBootstrapTask 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 createDhtBootstrapTask () {
- // Get new instance
- $taskInstance = new DhtBootstrapTask();
-
- // Return the prepared instance
- return $taskInstance;
- }
-
- /**
- * Accepts the visitor to process the visitor
- *
- * @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]
-?>
+++ /dev/null
-<?php
-/**
- * A ??? task for DHTs
- *
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 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 <http://www.gnu.org/licenses/>.
- */
-class Dht???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 createDht???Task () {
- // Get new instance
- $taskInstance = new Dht???Task();
-
- // Return the prepared instance
- return $taskInstance;
- }
-
- /**
- * Accepts the visitor to process the visitor
- *
- * @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]
-?>
--- /dev/null
+<?php
+/**
+ * A DhtBootstrap node-task
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.shipsimu.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 <http://www.gnu.org/licenses/>.
+ */
+class NodeDhtLateBootstrapTask 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 createNodeDhtLateBootstrapTask () {
+ // Get new instance
+ $taskInstance = new NodeDhtLateBootstrapTask();
+
+ // Get a DHT instance
+ $dhtInstance = DhtObjectFactory::createDhtInstance('node');
+
+ // Set the DHT instance here
+ $taskInstance->setDhtInstance($dhtInstance);
+
+ // Return the prepared instance
+ return $taskInstance;
+ }
+
+ /**
+ * Accepts the visitor to process the visitor
+ *
+ * @param $visitorInstance An instance of a Visitor class
+ * @return void
+ */
+ public function accept (Visitor $visitorInstance) {
+ // Visit this task
+ $visitorInstance->visitTask($this);
+ }
+
+ /**
+ * Executes the task
+ *
+ * @return void
+ */
+ public function executeTask () {
+ // Let the DHT class do the work for us
+ $this->getDhtInstance()->bootstrapDht();
+ }
+}
+
+// [EOF]
+?>