From 3474608ac13f68c1d10e65b63091dc26a2e7ea59 Mon Sep 17 00:00:00 2001 From: remilia Date: Sat, 18 Jan 2025 21:05:23 +0800 Subject: [PATCH] add zmqtest --- test/testcppzmq.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/testcppzmq.py b/test/testcppzmq.py index def3365..9890f99 100644 --- a/test/testcppzmq.py +++ b/test/testcppzmq.py @@ -1,8 +1,17 @@ import zmq +import time +import sys if __name__ == '__main__': + s = sys.argv[1] ctx = zmq.Context() + sock = ctx.socket(zmq.REQ) + sock.connect('tcp://11.6.1.66:5556') +# time.sleep(1) + sock.send(s.encode()) + print(sock.recv()) + exit(0) sock = ctx.socket(zmq.PULL) sock.bind('tcp://0.0.0.0:5558') while True: s = sock.recv() - print(s) \ No newline at end of file + print(s)