[zeromq-dev] PUSH Socket is queued?

Stéphane Wirtel stephane at wirtel.be
Wed Feb 26 17:29:59 CET 2014


Hi all,

I wanted to know if there is a queue for the message of a PUSH socket, 
because my send is blocking or in error with the EAGAIN error.

Here is the example:

#!/usr/bin/env python

import zmq

context = zmq.Context()

sender = context.socket(zmq.PUSH)
sender.bind('tcp://*:5557')

for task in range(100):
     print task
     sender.send_string(u'%d' % task, zmq.DONTWAIT)

sender.close()
context.terminate()

> (zmq) python push.py
0
Traceback (most recent call last):
   File "push.py", line 12, in <module>
     sender.send_string(u'%d' % task, zmq.DONTWAIT)
   File 
"/Users/stephane/.virtualenvs/zmq/lib/python2.7/site-packages/zmq/sugar/socket.py", 
line 290, in send_string
     return self.send(u.encode(encoding), flags=flags, copy=copy)
   File "socket.pyx", line 565, in zmq.backend.cython.socket.Socket.send 
(zmq/backend/cython/socket.c:5104)
   File "socket.pyx", line 620, in zmq.backend.cython.socket.Socket.send 
(zmq/backend/cython/socket.c:4972)
   File "socket.pyx", line 156, in zmq.backend.cython.socket._send_frame 
(zmq/backend/cython/socket.c:1842)
   File "checkrc.pxd", line 15, in zmq.backend.cython.checkrc._check_rc 
(zmq/backend/cython/socket.c:5784)
zmq.error.Again: Resource temporarily unavailable

Do you have an idea?

Thanks

Regards,

Stephane



More information about the zeromq-dev mailing list