Example #1
0
 def rejoinNetwork(self):
     """
     更换自身node ID, 清空路由表, 再重新加入DHT网络.
     """
     self.table.nid = nodeID()
     self.table.buckets = [ KBucket(0, 2**160) ]
     self.joinNetwork()
Example #2
0
 def changeNodeID(self):
     if len(self.table) / ((158 * K)+0.0) >= 0.8:
         id = nodeID()
         self.snid = self.table.nid[0:3] + id[3:]
Example #3
0
 def changeNodeID(self):
     if len(self.table) / ((158 * K) + 0.0) >= 0.8:
         id = nodeID()
         self.snid = self.table.nid[0:3] + id[3:]