def serve():
    server = grpc.server(futures.ThreadPoolExecutor(max_workers=50))
    greet_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server)
    network_manager_pb2_grpc.add_NetworkManagerServicer_to_server(NetworkManager(), server)
    server.add_insecure_port("[::]:" + str(globals.port))
    logger.info("Server starting at port " + str(globals.port))
    server.start()
    server.wait_for_termination()
Exemple #2
0
def serve():
    server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
    greet_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server)
    server.add_insecure_port('[::]:50051')
    server.start()
    try:
        while True:
            time.sleep(_ONE_DAY_IN_SECONDS)
    except KeyboardInterrupt:
        server.stop(0)
def serve(port):
    logging.info(f'Starting gRPC server on port[{port}]')
    server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
    server.add_insecure_port(f'[::]:{port}')
    greet_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server)

    server.start()
    try:
        while True:
            sleep(_ONE_DAY_IN_SECONDS)
    except KeyboardInterrupt:
        server.stop(0)
def serve():
    server = grpc.server(futures.ThreadPoolExecutor(max_workers=50))
    greet_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server)
    network_manager_pb2_grpc.add_NetworkManagerServicer_to_server(
        NetworkManager(), server)
    traversal_pb2_grpc.add_TraversalServicer_to_server(Traversal(), server)
    server.add_insecure_port("[::]:" + str(globals.port))
    logger.info("Server starting at port " + str(globals.port))
    storage_pb2_grpc.add_FileServerServicer_to_server(globals.storage_object,
                                                      server)
    server.add_insecure_port("[::]:" + str(globals.port))
    logger.info("Server starting at port " + str(globals.port))
    replication_pb2_grpc.add_FileserviceServicer_to_server(
        ReplicationService(), server)
    server.start()
    server.wait_for_termination()
def serve():
    server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
    greet_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server)
    server.add_insecure_port('[::]:5001')
    server.start()
    server.wait_for_termination()