This commit is contained in:
vn.py 2018-12-24 09:43:17 +08:00
parent 55ee5ea9b1
commit bc49cde7f0

View File

@ -47,12 +47,13 @@ class TcEngine(object):
self.mode = self.MODE_PROVIDER self.mode = self.MODE_PROVIDER
self.interval = interval self.interval = interval
self.server = RpcServer(repAddress, pubAddress) if not self.server:
self.server.usePickle() self.server = RpcServer(repAddress, pubAddress)
self.server.register(self.getPos) self.server.usePickle()
self.server.start() self.server.register(self.getPos)
self.server.start()
self.writeLog(u'启动发布者模式') self.writeLog(u'启动发布者模式(如需修改通讯地址请重启程序)')
#---------------------------------------------------------------------- #----------------------------------------------------------------------
def startSubscriber(self, reqAddress, subAddress, copyRatio): def startSubscriber(self, reqAddress, subAddress, copyRatio):
@ -60,13 +61,13 @@ class TcEngine(object):
self.mode = self.MODE_SUBSCRIBER self.mode = self.MODE_SUBSCRIBER
self.copyRatio = copyRatio self.copyRatio = copyRatio
self.client = TcClient(self, reqAddress, subAddress) if not self.client:
self.client.usePickle() self.client = TcClient(self, reqAddress, subAddress)
self.client.subscribeTopic('') self.client.usePickle()
self.client.start() self.client.subscribeTopic('')
self.client.start()
self.writeLog(u'启动订阅者模式,运行时请不要执行其他交易操作')
self.writeLog(u'启动订阅者模式,运行时请不要执行其他交易操作')
self.initTarget() self.initTarget()
#---------------------------------------------------------------------- #----------------------------------------------------------------------