import time
import zmq

context = zmq.Context()
socket = context.socket(zmq.SUB)
socket.connect("tcp://localhost:6666")
#设置订阅主题
socket.setsockopt(zmq.SUBSCRIBE, b'')

cnt = 0
while True:
    # wait for next request from client
    message = socket.recv_multipart()
    # Do some work
    cnt = cnt + 1
    print(cnt)
