def __init__(self, urn=createURN("peer"),serverPort=4000, maxNeighbor=1): AbstractPeer.initialize(self, urn,serverPort, maxNeighbor)
def __init__(self, urn=createURN("peer"),serverPort=4000, maxNeighbor=1): AbstractPeer.initialize(self, urn,serverPort,maxNeighbor,peerType = AbstractPeer.PORTAL) self.__superPeers = {} self.__dimension = 1
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
def __init__(self,network, pid=createURN("rpycpeer"),udpPort=4000): AbstractPeer.initialize(self, network, pid,udpPort)
def __init__(self, urn=createURN("peer"),serverPort=4000, maxNeighbor=1): self.__superPeerNeighbors = {} self.__levelNeighbor = 1 AbstractPeer.initialize(self, urn,serverPort, maxNeighbor, peerType = AbstractPeer.SUPER)