]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/dht/node/class_NodeDhtFacade.php
Rewrites, some more methods:
[hub.git] / application / hub / main / dht / node / class_NodeDhtFacade.php
index 44efb9a1b92cc5971eb4ee50ddbfcc9a582dc66f..dd6d13a1c8a05c299109b3687fa898b92cc8d457 100644 (file)
@@ -52,13 +52,20 @@ class NodeDhtFacade extends BaseDht implements Distributable, Registerable {
        }
 
        /**
-        * Initializes the distributable hash table (DHT)
+        * Initializes the distributed hash table (DHT)
         *
         * @return      void
         * @todo        Please implement this method
         */
        public function initDht () {
-               $this->partialStub('Please implement this method.');
+               // Is the local node registered?
+               if ($this->getWrapperInstance()->isLocalNodeRegistered()) {
+                       // Then only update session id
+                       $this->getWrapperInstance()->updateLocalNode();
+               } else {
+                       // No, so register it
+                       $this->getWrapperInstance()->registerLocalNode();
+               }
        }
 }