[zeromq-dev] ZMQ::SocketError: Operation cannot be accomplished in current state

Sean Grove sean at bushi.do
Mon Apr 11 14:25:55 CEST 2011


Thanks, will check this out.

I've begun work implementing zeromq into rails, but the async method doesn't
work at all for the REQ/REP model and rails' very synchronous model, as far
as I can tell so far. I'll check out the lazy pirate pattern today though, I
think that should likely solve this.

Thank you!

All the best,
Sean

On Mon, Apr 11, 2011 at 1:25 AM, Pieter Hintjens <ph at imatix.com> wrote:

> On Mon, Apr 11, 2011 at 8:51 AM, Sean Grove <sean at bushi.do> wrote:
>
> > I'm using ZeroMQ 2.0.11, and the ruby ffi-rzmq (0.7.2) bindings, and I
> seem
> > to run into this. The code in question is a REQ/REP pair running in
> separate
> > processes, and everything works fine the first time through. The second
> > time, I get the above error.
> > I'd love to better understand what state the socket is in that it's dying
> > here - how can I go about fixing this?
>
> If the second time through your REQ socket complains, it's because it
> didn't get a reply to its request, and you're trying to send a second
> request.
>
> Usually you can make this work by sticking to a synchronous
> request-reply dialog. If you really want an asynchronous dialog,
> switch to a dealer (xreq) socket. If you want to use a synchronous
> request-reply dialog but be able to resend a request, use the Lazy
> Pirate pattern from Ch4 of the Guide, i.e. close the socket, reopen,
> send again.
>
> -Pieter
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110411/6a31b285/attachment.htm>


More information about the zeromq-dev mailing list