From 7211b3332bdc2692391a677f4d934a095e7be5f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 17 May 2012 19:22:53 +0000 Subject: [PATCH] Added method nodeHasSelfConnected() which changes the state to 'reachable' which is true from the node's self-view --- .../states/node/active/class_NodeActiveState.php | 14 ++++++++++++++ .../main/states/node/init/class_NodeInitState.php | 1 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/application/hub/main/states/node/active/class_NodeActiveState.php b/application/hub/main/states/node/active/class_NodeActiveState.php index d73bc9900..96de63ac1 100644 --- a/application/hub/main/states/node/active/class_NodeActiveState.php +++ b/application/hub/main/states/node/active/class_NodeActiveState.php @@ -64,6 +64,20 @@ class NodeActiveState extends BaseNodeState implements Stateable { // Create the new state instance NodeStateFactory::createNodeStateInstanceByName('announced', $this->getNodeInstance()); } + + /** + * State change for if the node has just connected to itself and + * node/session id are both equal. The self-connect means that + * the node possibly reachable from outside. This may require + * confirmation by other peers. + * + * @return void + * @todo We might want to move some calls to this method to fill it with life + */ + public function nodeHasSelfConnected () { + // Create the new state instance + NodeStateFactory::createNodeStateInstanceByName('reachable', $this->getNodeInstance()); + } } // [EOF] diff --git a/application/hub/main/states/node/init/class_NodeInitState.php b/application/hub/main/states/node/init/class_NodeInitState.php index a8bd59f1a..68b968ef1 100644 --- a/application/hub/main/states/node/init/class_NodeInitState.php +++ b/application/hub/main/states/node/init/class_NodeInitState.php @@ -63,7 +63,6 @@ class NodeInitState extends BaseNodeState implements Stateable { // Create the new state instance NodeStateFactory::createNodeStateInstanceByName('virgin', $this->getNodeInstance()); } - } // [EOF] -- 2.39.5