def __init__(self, masterip, route): # Path self.masterip = masterip self.route = route self.hops = 0 # use the masterip, create a socket, see it's ip. self.localip = getCurrentIP(masterip) # DON'T KNOW self.plusval = 1 # Code career # Has to be signed by the server, otherwise wont work. self.compLocal = CompLocal() self.serverSignature = ""
def handle(self): import cPickle from migrate import * print "Receving incoming agent, verification is in process ..." print "From client:", self.client_address f = self.request.makefile() career = cPickle.load(f) agent = career.unloadAgent() #Welcome! agent.localip = getCurrentIP(agent.masterip) try: agent.compute() agent.dispInfo() except: print "Agent execution on host failed." return -1 if (migrate(agent) == 0): print "\t Agent mission acomplished" return 0