Questions tagged [pyzmq]

PyZMQ is the Python bindings for 0MQ (also spelled ZeroMQ, ØMQ or ZMQ), written almost entirely in Cython

Python bindings for 0MQ, a high-performance asynchronous messaging library aimed at use in scalable distributed or concurrent applications. It provides a message queue, but unlike message-oriented middleware, a 0MQ system runs without a dedicated message broker.

For a brief introduction read the ZeroMQ concept & properties from

PyZMQ works with Python 3 (≥ 3.3), and Python 2.7, with no transformations or 2to3, as well as PyPy (at least 2.0 beta), via CFFI.

PyZMQ started it python journey since the ZeroMQ API v2.1.1, those days in Python 2.6

Useful links:

627 questions
7
votes
1 answer

Zeromq which socket should bind on PubSub pattern

I have been reading about ZeroMQ more specifically about NetMQ and almost every Pub/Sub examples I saw used to Bind the Publisher socket and then the Subscriber socket connects to the other. So i'm wondering if it is possible to do the reverse, i…
mmarques
  • 625
  • 3
  • 9
  • 27
7
votes
2 answers

zmq.error.ZMQError: No such device

I got this error in my program: Traceback (most recent call last): File "scriptA.py", line 17, in socketPub.bind("tcp://localhost:%s"% portPub) File "socket.pyx", line 434, in zmq.backend.cython.socket.Socket.bind…
Biribu
  • 535
  • 3
  • 12
  • 27
7
votes
1 answer

socket handle leak in pyzmq?

Hi good people of StackOverflow. I'm using pyzmq and I've got some long-running processes, which led to a discovery that socket handles are being left open. I've narrowed the offending code down to the following: import zmq uri =…
Cari
  • 997
  • 1
  • 10
  • 16
7
votes
1 answer

Termination of python script while using ZeroMQ with dead server

I have a problem in closing python application while I using ZeroMQ. first I connect to a server that is not running! context = zmq.Context() socket = context.socket(zmq.REQ) socket_id = randomID() socket.setsockopt(zmq.IDENTITY,…
GTavasoli
  • 448
  • 4
  • 11
6
votes
2 answers

Python ZMQ responder not receiving message

I am trying a simple zmq script but somehow the responder is not getting the first message. The Responder looks like this: def main(): context = zmq.Context() socket = context.socket(zmq.REP) …
GöCo
  • 85
  • 6
6
votes
1 answer

Create a group of streamers and publishers

I have a number of nodes that will use a secondary service to be informed about the address of each other. I want to be able to publish information so as all the other nodes can hear it. Using an XPUB socket is not an option I would want to go with…
dearn44
  • 3,198
  • 4
  • 30
  • 63
6
votes
1 answer

How to send both image(ndarray) and string data in single ZMQ send request

For sending string data, following codes works : context = zmq.Context() socket = context.socket(zmq.PUB) socket.bind("tcp://*:5667") socket.send_string("my string data") For sending image(ndarray) following code works : def send_array(socket,…
Rohit Lal
  • 2,791
  • 1
  • 20
  • 36
6
votes
2 answers

Python 3.6 ZeroMQ (PyZMQ) asyncio pub sub Hello World

I've just started with ZeroMQ and I'm trying to get a Hello World to work with PyZMQ and asyncio in Python 3.6. I'm trying to de-couple the functionality of a module with the pub/sub code, hence the following class setup: Edit 1: Minimized…
NumesSanguis
  • 5,832
  • 6
  • 41
  • 76
6
votes
1 answer

ZeroMQ hangs in a python multiprocessing class/object solution

I'm trying to use ZeroMQ in Python (pyzmq) together with multiprocessing. As a minmal (not) working example I have a server- and a client-class which both inherit from multiprocessing.Process. The client as a child-process should send a message to…
kernstock
  • 224
  • 2
  • 10
6
votes
1 answer

ZeroMQ buffer size v/s High Water Mark

In the zeromq socket options, we have flags for both a high water mark and a buffer size. For sending, it's ZMQ_SNDHWM and ZMQ_SNDBUF. Can someone explain the difference between these two?
CR7
  • 125
  • 1
  • 10
6
votes
3 answers

ZeroMQ pyzmq send jpeg image over tcp

I am trying to send a jpeg image file through a ZeroMQ connection with pyzmq, but the output is 3 times the size of the input, and no longer a valid jpeg. I load the image and send with... f = open("test1.jpg",'rb') strng =…
user3325088
  • 65
  • 1
  • 4
6
votes
1 answer

Sniffer/monitor in client/server config with ZMQ in Python

I implemented a client/server via ZeroMQ and I would like to add a sniffer/monitor to capture the communication between the two. client <---------> server (REQ) | (REP) | …
flamenco
  • 2,702
  • 5
  • 30
  • 46
6
votes
1 answer

How to downgrade zeromq from version 4.0.4 to 3.2.4

I Have installed zeromq 4.0.4 in my ubuntu machine.i have to downgrade my zmq to 3.2.4. i have tried sudo make uninstall , sudo make clean but none of them worked so far. and i also installed 3.2.4 from source. but still my system showing zmq…
Naveen Subramani
  • 2,134
  • 7
  • 20
  • 27
6
votes
1 answer

ZeroMQ PubSub not working w\ Pyzmq

There is probably something very small that I am missing but I am unable to get a simple pub-sub example working in Python using the official Pyzmq package (https://github.com/zeromq/pyzmq). I am using the latest ZeroMQ stable release 4.0.3 and am…
Stephen
  • 125
  • 1
  • 6
6
votes
1 answer

ZeroMQ: have to sleep before send

I'm write a zeromq demo with Forwarder device (with pyzmq) Here are the codes(reference to https://learning-0mq-with-pyzmq.readthedocs.org/en/latest/pyzmq/devices/forwarder.html ): forwarder.py import zmq context = zmq.Context() frontend =…
wong2
  • 34,358
  • 48
  • 134
  • 179
1 2
3
41 42