add zmqtest
This commit is contained in:
parent
df30702ac0
commit
3474608ac1
@ -1,8 +1,17 @@
|
|||||||
import zmq
|
import zmq
|
||||||
|
import time
|
||||||
|
import sys
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
s = sys.argv[1]
|
||||||
ctx = zmq.Context()
|
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 = ctx.socket(zmq.PULL)
|
||||||
sock.bind('tcp://0.0.0.0:5558')
|
sock.bind('tcp://0.0.0.0:5558')
|
||||||
while True:
|
while True:
|
||||||
s = sock.recv()
|
s = sock.recv()
|
||||||
print(s)
|
print(s)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user