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 <[email protected]> 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 > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
