1234567891011121314151617181920212223 |
- import logging as Log
- import grpc,argparse,time,sys,threading
- import mllp_grpc.sim_mt_pb2_grpc as sim_mt_pb2_grpc
- import mllp_grpc.sim_mt_pb2 as sim_mt_pb2
- import mllp_grpc.sim_mt_common_pb2 as sim_mt_common_pb2
- import google.protobuf.empty_pb2 as empty_pb2
- SMT_SERVER_HOST = "localhost"
- SMT_SERVER_PORT = 8043
- SMT_SYSTEM_HOST = "localhost"
- SMT_SYSTEM_PORT = 8044
- if __name__=='__main__':
- addr= '%s:%d'%(SMT_SERVER_HOST, SMT_SERVER_PORT)
- with grpc.insecure_channel(addr) as channel:
- stub= sim_mt_pb2_grpc.SimMTStub(channel)
- for info in stub.GetSystemsInfo(empty_pb2.Empty()):
- print(info)
- res= stub.AddSystem(sim_mt_pb2.AddSystemRequest(host=SMT_SYSTEM_HOST,
- port=SMT_SYSTEM_PORT))
- for info in stub.GetSystemsInfo(empty_pb2.Empty()):
- print(info)
|