richardmillen / zguide-examples

Implementations of the 0MQ examples in the guide.
http://zguide.zeromq.org/page:all
4 stars 0 forks source link

Client-Side Reliability (Lazy Pirate Pattern) in C++ #11

Closed richardmillen closed 7 years ago

richardmillen commented 7 years ago

Implement the Client-Side Reliability (Lazy Pirate Pattern) example.

We can get very simple reliable request-reply with some changes to the client. We call this the Lazy Pirate pattern. Rather than doing a blocking receive, we: Poll the REQ socket and receive from it only when it's sure a reply has arrived. Resend a request, if no reply has arrived within a timeout period. Abandon the transaction if there is still no reply after several requests.