]> git.mxchange.org Git - hub.git/commitdiff
Added method nodeHasSelfConnected() which changes the state to 'reachable' which...
authorRoland Häder <roland@mxchange.org>
Thu, 17 May 2012 19:22:53 +0000 (19:22 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 17 May 2012 19:22:53 +0000 (19:22 +0000)
application/hub/main/states/node/active/class_NodeActiveState.php
application/hub/main/states/node/init/class_NodeInitState.php

index d73bc99008210a887277d89c12d2576ff1d675c8..96de63ac11e107676f173cbdf9c2feecf6f6d78a 100644 (file)
@@ -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]
index a8bd59f1a8df793ecf8a6ee790f00743f88624ab..68b968ef181a04ee9ee5a6703f5cf7507c9212cc 100644 (file)
@@ -63,7 +63,6 @@ class NodeInitState extends BaseNodeState implements Stateable {
                // Create the new state instance
                NodeStateFactory::createNodeStateInstanceByName('virgin', $this->getNodeInstance());
        }
-
 }
 
 // [EOF]