moved sample zmq SUB client to test/

Former-commit-id: ab13e10271
This commit is contained in:
Arthur Lu
2021-10-16 20:21:12 +00:00
parent 6bcb3cbff4
commit dafd66447f

14
test/client.py Normal file
View File

@@ -0,0 +1,14 @@
import signal
import zmq
signal.signal(signal.SIGINT, signal.SIG_DFL)
context = zmq.Context()
socket = context.socket(zmq.SUB)
socket.connect('tcp://localhost:5678')
socket.setsockopt(zmq.SUBSCRIBE, b'status')
while True:
message = socket.recv_multipart()
print(f'Received: {message}')