ZMQError: Resource temporarily unavailable

dieter dieter at
Fri Oct 10 07:57:49 CEST 2014

karthik.sharma at writes:

> I am using zero-mq for IPC between two machines.
> My zmq function is given below
>     def recieve_messages(self):
>              string = self.sub_socket.recv(flags=zmq.NOBLOCK)
>              print('flow mod messages recieved {}'.format(string))
> When I run the program however I get the following error.
>       string = self.sub_socket.recv(flags=zmq.NOBLOCK)
>       File "socket.pyx", line 616, in zmq.core.socket.Socket.recv (zmq/core/socket.c:5961)
>       File "socket.pyx", line 650, in zmq.core.socket.Socket.recv (zmq/core/socket.c:5832)
>       File "socket.pyx", line 119, in zmq.core.socket._recv_copy (zmq/core/socket.c:1669)
>     ZMQError: Resource temporarily unavailable
> Can someone explain what is likely causing this error.

The most likely cause is that you try to receive data while there
is none available. Usually, with non blocking operations, you
start them only after you know they can succeed. If the operation
is impossible, you will get an exception (and "Resource temporarily
unavailable" seems a good candidate).

More information about the Python-list mailing list