fix
This commit is contained in:
parent
3474608ac1
commit
eb78c4a211
@ -1,17 +1,24 @@
|
|||||||
|
import struct
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
import zmq
|
import zmq
|
||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
if __name__ == '__main__':
|
|
||||||
s = sys.argv[1]
|
def f0():
|
||||||
ctx = zmq.Context()
|
ctx = zmq.Context()
|
||||||
sock = ctx.socket(zmq.REQ)
|
sock = ctx.socket(zmq.REQ)
|
||||||
sock.connect('tcp://11.6.1.66:5556')
|
sock.connect('tcp://11.6.1.66:5556')
|
||||||
# time.sleep(1)
|
sock.send(b'file' + Path('/home/lambda/source/scarlet/flandre/config/64-1.txt').read_bytes())
|
||||||
sock.send(s.encode())
|
|
||||||
print(sock.recv())
|
|
||||||
exit(0)
|
def f1():
|
||||||
|
ctx = zmq.Context()
|
||||||
sock = ctx.socket(zmq.PULL)
|
sock = ctx.socket(zmq.PULL)
|
||||||
sock.bind('tcp://0.0.0.0:5558')
|
sock.connect('tcp://11.6.1.66:5556')
|
||||||
while True:
|
while True:
|
||||||
s = sock.recv()
|
s = sock.recv()
|
||||||
print(s)
|
print(struct.unpack('=iqi', s))
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
f1()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user