Skip to content

Instantly share code, notes, and snippets.

@minrk
Last active August 22, 2024 10:55
Show Gist options
  • Save minrk/46bd0ad0886506d178de28de889e7123 to your computer and use it in GitHub Desktop.
Save minrk/46bd0ad0886506d178de28de889e7123 to your computer and use it in GitHub Desktop.
zmqtest.py
import zmq
print("imported")
print("has", zmq.has("ipc"))
with zmq.Context() as ctx:
print("context")
with ctx.socket(zmq.PUSH) as push, ctx.socket(zmq.PULL) as pull:
print("sockets")
url = "tcp://127.0.0.1:5555"
push.bind(url)
print("bind")
pull.connect(url)
print("connect")
push.send(b"x")
print("send")
pull.recv()
print("recv")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment