eis/py/proxy/test.py

31 lines
949 B
Python
Raw Normal View History

#!/usr/bin/python3
#import sys, Ice
#import MessageICE_ice
#_M_baosight = Ice.openModule('baosight')
#with Ice.initialize(sys.argv) as communicator:
# base = communicator.stringToProxy("baosight/pdb").ice_oneway().ice_secure(False)
# proxy = _M_baosight.MessageICEPrx.uncheckedCast(base)
# if not proxy:
# print("invalid proxy")
# sys.exit(1)
# seq= b"ptest2: test3"
# proxy.SendDataShort(1000, seq,len(seq))
from IceProxy import *
seq= b"ptest2: test3"
#IceProxy.SendDataShort(1000,'baosight/pdb',seq,5000)
IceProxy.SendDataShort(1000,'baosight/pdb',seq)
if __name__ == "__main__":
with Ice.initialize(sys.argv) as communicator:
# 在此处创建并存储需要的代理
proxyname = 'baosight/pdb'
proxy = IceProxy.GetICEPrx(proxyname,communicator)
# 使用代理来执行需要的操作
if proxy:
print(proxy)
proxy.SendDataShort(1, seq,len(seq))