Skip to content

Instantly share code, notes, and snippets.

@guillaumevincent
Created January 15, 2017 11:12
Show Gist options
  • Select an option

  • Save guillaumevincent/e7cddfdb39aa3c6d968af1d25ea35d9d to your computer and use it in GitHub Desktop.

Select an option

Save guillaumevincent/e7cddfdb39aa3c6d968af1d25ea35d9d to your computer and use it in GitHub Desktop.
zmq lost message PUSH/PULL
$ python push.py
message n°0
message n°1
message n°2
message n°3
message n°4
message n°5
message n°6
message n°7
message n°8
message n°9
python pull.py
Received message n°0
Received message n°1
Received message n°4
Received message n°7
python pull.py
Received message n°2
Received message n°5
Received message n°8
Lost message 3,6 and 9
import zmq
context = zmq.Context()
socket = context.socket(zmq.PULL)
socket.connect("tcp://127.0.0.1:5557")
while True:
print("Received %s" % socket.recv_string())
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.PUSH)
socket.bind("tcp://127.0.0.1:5557")
for i in range(10):
message = "message n°%d" % i
print(message)
socket.send_string(message)
time.sleep(1)
@makerjackie
Copy link
Copy Markdown

any udpate?

@guillaumevincent
Copy link
Copy Markdown
Author

no update, the issue is still present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment