25 lines
505 B
Python
25 lines
505 B
Python
import struct
|
|
from pathlib import Path
|
|
|
|
import zmq
|
|
import time
|
|
import sys
|
|
|
|
def f0():
|
|
ctx = zmq.Context()
|
|
sock = ctx.socket(zmq.REQ)
|
|
sock.connect('tcp://11.6.1.66:5556')
|
|
sock.send(b'file' + Path('/home/lambda/source/scarlet/flandre/config/64-1.txt').read_bytes())
|
|
|
|
|
|
def f1():
|
|
ctx = zmq.Context()
|
|
sock = ctx.socket(zmq.PULL)
|
|
sock.connect('tcp://11.6.1.66:5556')
|
|
while True:
|
|
s = sock.recv()
|
|
print(struct.unpack('=iqi', s))
|
|
|
|
if __name__ == '__main__':
|
|
f1()
|