18 lines
332 B
Python
18 lines
332 B
Python
import time
|
|
|
|
import zmq
|
|
|
|
c = zmq.Context()
|
|
s = c.socket(zmq.REP)
|
|
# s.setsockopt(zmq.HEARTBEAT_IVL, 1000)
|
|
# s.setsockopt(zmq.HEARTBEAT_TTL, 1000)
|
|
# s.setsockopt(zmq.HEARTBEAT_TIMEOUT, 1000)
|
|
s.bind('tcp://127.0.0.1:5555')
|
|
while True:
|
|
s.recv()
|
|
print('recv')
|
|
time.sleep(2)
|
|
print('send')
|
|
s.send(b'hello')
|
|
# break
|