Esempio n. 1
0
class Client(object):
    def __init__(self):
        self.discoClient = DiscoveryClient()
        self.transClient = TransportClient()
        self.myLocation = Location("127.0.0.1", 3456)
        self.groupLocation = Location("239.192.1.100", 50000)

    def run(self):
        self.discoClient.send(location=self.groupLocation.get_tuple(), data=self.myLocation)
        maven_location = self.discoClient.receive(ip=self.myLocation.ip, port=self.myLocation.port)
        print("First node is: ", maven_location)

        self.transClient.setLocation(maven_location)
        employees = self.transClient.getEmployees(b"client")

        print(len(employees))
        print(employees)
Esempio n. 2
0
 def __init__(self):
     self.discoClient = DiscoveryClient()
     self.transClient = TransportClient()
     self.myLocation = Location("127.0.0.1", 3456)
     self.groupLocation = Location("239.192.1.100", 50000)