[zeromq-dev] Lazy pirate alternative implementation

Pieter Hintjens ph at imatix.com
Thu Jun 12 23:33:48 CEST 2014

You're polling the same socket twice, which isn't necessary. Also, if
you use libzmq/4.x you can use ZMQ_REQ_RELAXED: and that makes Lazy
Pirate obsolete.

On Thu, Jun 12, 2014 at 10:54 PM, Dmitri Toubelis
<dmitri.toubelis at alkeron.com> wrote:
> Hi,
> I needed to implement a pattern similar to "lazy pirate" from the guide for my project. However, the idea of reconnecting the socket upon timeout looks kind of lame to me, so I implemented it differently:
> http://pastebin.com/KFSBtK8C
> It works okay but is there anything obviously wrong with this approach? Are there any potential gotchas?
> P.S.: I'm using ZMQ 2.1.x
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

More information about the zeromq-dev mailing list