apppublic/test/zmqreply.py

16 lines
216 B
Python
Raw Normal View History

2022-02-28 12:06:25 +08:00
from appPublic.zmq_reqrep import ZmqReplier
import time
def handler(b):
print(b.decode('utf-8'))
return 'got it'
2022-03-03 12:52:18 +08:00
x = ZmqReplier('tcp://127.0.0.1:5555', handler)
2022-02-28 12:06:25 +08:00
x.run()
f = 0
while 1:
time.sleep(0.1)
x.stop()