Пример #1
0
    def __init__(self):
        self.host = '127.0.0.1'
        self.port = 46001

        # communication channel instance.
        self.channel = grpc.insecure_channel(f'{self.host}:{self.port}')

        self.stub = digestor_pb2_grpc.DigestorStub(self.channel)
Пример #2
0
    def __init__(self):
        self.host = 'localhost'
        self.server_port = 46001

        self.channel = grpc.insecure_channel(
                        '{}:{}'.format(self.host, self.server_port))
 

        self.stub = digestor_pb2_grpc.DigestorStub(self.channel)
Пример #3
0
    def __init__(self):
        self.host = "localhost"
        self.port = 46001

        # instantiate a communication channel
        self.channel = grpc.insecure_channel(f"{self.host}:{self.port}")

        # bind the client to the server channel
        self.stub = digestor_pb2_grpc.DigestorStub(self.channel)
Пример #4
0
    def __init__(self):
        # configure the host and the
        # the port to which the client should connect
        # to.
        self.host = 'localhost'
        self.server_port = 46001

        # instantiate a communication channel
        self.channel = grpc.insecure_channel('{}:{}'.format(
            self.host, self.server_port))

        # bind the client to the server channel
        self.stub = digestor_pb2_grpc.DigestorStub(self.channel)
    def __init__(self):
        # configure the host and the
        # the port to which the client should connect
        # to.
        self.host = sys.argv[1]
        self.server_port = sys.argv[2]

        # sanity check
        print("Connecting to " + self.host + " on port " +
              str(self.server_port) + ".")

        # instantiate a communication channel
        self.channel = grpc.insecure_channel('{}:{}'.format(
            self.host, self.server_port))

        # bind the client to the server channel
        self.stub = digestor_pb2_grpc.DigestorStub(self.channel)