def __init__(self, app, ctx, port=6606):
self.app = app
self.ctx = ctx
self.publisher = self.ctx.socket(zmq.PUB)
self.publisher.bind("tcp://*:" + str(port))
self.snapshot = ctx.socket(zmq.ROUTER)
self.snapshot.bind("tcp://*:" + str(port+2))
self.snapshot = ZMQStream(self.snapshot)
self.snapshot.on_recv(self.handle_snapshot)
self.seqNr = 0
评论列表
文章目录