[zeromq-dev] XReq 'Resource temporarily unavailable'

Martin Sustrik sustrik at 250bpm.com
Mon Apr 25 07:45:11 CEST 2011


Hi Andrew,

> require 'ffi-rzmq'
> ctx = ZMQ::Context.new 1
> sock = ctx.socket(ZMQ::XREQ)
> sock.bind('tcp://127.0.0.1:8000 <http://127.0.0.1:8000>')
> sock.send_string('',ZMQ::SNDMORE | ZMQ::NOBLOCK)
> sock.send_string('oh hai', ZMQ::NOBLOCK)
>
> I get 'Resource temporarily unavailable' errors ONLY if there is no xrep
> socket listening on the other end. Is this intentional? This seems odd.

0MQ creates a queue per peer. Thus, if there's no peer there's nowhere 
to store the message to.

In theory, we can fix the behaviour by creating one queue in advance 
(when there's no peer connected yet) and assigning it to the first 
connected peer. That requires some work to be done in 0MQ core though.

Martin



More information about the zeromq-dev mailing list