예제 #1
0
    def __init__(self, urn=createURN("peer"),serverPort=4000, maxNeighbor=1):
        
        AbstractPeer.initialize(self,  urn,serverPort, maxNeighbor)
    
    

        
예제 #2
0
 def __init__(self, urn=createURN("peer"),serverPort=4000, maxNeighbor=1):
     
     AbstractPeer.initialize(self,  urn,serverPort,maxNeighbor,peerType = AbstractPeer.PORTAL)
     
     
     self.__superPeers = {}
     
     self.__dimension = 1
예제 #3
0
 def createConnection(self, target):
     if not self.isConnected(target) and self.countNeighbor() <= self.getNetwork().getMaxNeighbor() :
         AbstractPeer.createConnection(self,target)
         try:
             self.conn = rpyc.connect(target.getIPAddress(), target.getPort())
             Logger().resgiterLoggingInfo("Conectioned in  peers IP = %s  Port = %s"%(target.getIPAddress(), target.getPort()))
         except Exception:
             self.conn = None
             Logger().resgiterLoggingInfo("Not Conectioned in  peers IP = %s  Port = %s"%(target.getIPAddress(), target.getPort()))
             '''m=gtk.MessageDialog(buttons = gtk.BUTTONS_OK, 
                 type = gtk.MESSAGE_ERROR, 
                 flags = gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, 
                 message_format="Connection refused")
             m.run()
             m.destroy()
             '''
             return
예제 #4
0
 def __init__(self,network, pid=createURN("rpycpeer"),udpPort=4000):
     
     AbstractPeer.initialize(self,  network, pid,udpPort)
예제 #5
0
 def __init__(self, urn=createURN("peer"),serverPort=4000, maxNeighbor=1):
     
     self.__superPeerNeighbors = {}
     self.__levelNeighbor = 1
     
     AbstractPeer.initialize(self, urn,serverPort, maxNeighbor, peerType = AbstractPeer.SUPER)