[zeromq-dev] REP/REQ state-locking
Pieter Hintjens
ph at imatix.com
Thu Apr 28 18:29:54 CEST 2011
On Thu, Apr 28, 2011 at 6:16 PM, Amr Ali <amr.ali.cc at gmail.com> wrote:
> I've stumbled upon the problem that when for whatever reason a send from a REQ
> socket can't be complemented by a recv, the state locked and there is no way
> (IIRC) to reset the socket to be able to continue using it.
You close and reopen the socket.
It's actually more elegant than it sounds, especially if you're
resending requests, because any en-route replies will be discarded.
Here's more detail on that:
http://zguide.zeromq.org/page:all#Client-side-Reliability-Lazy-Pirate-Pattern
> I've seen a couple
> of emails suggesting the usage of XREP/XREQ over the pattern locked REP/REQ
> sockets, which works for me, however, are there any plans to mitigate the
> situation? I think this can be solved by providing a reset functionality for a
> certain socket. I believe such functionality is needed regardless of the socket
> type anyways.
While a reset option sounds good, it probably won't work as well as
closing/reopening the socket, which generates a new identity.
-Pieter
More information about the zeromq-dev
mailing list