[zeromq-dev] using REQ in a real application
Matt Connolly
matt.connolly at me.com
Thu Jul 18 22:43:52 CEST 2013
On 19 Jul 2013, at 5:52 am, Justin Karneges <justin at affinix.com> wrote:
> Hi,
>
> I have a couple of concerns about using REQ.
>
> 1) In order to implement timeouts (which I'd think nearly every
> application should need), I use the following strategy:
> a) If I cannot write to the socket after enough time has passed, then
> I consider the request to have failed and I leave the socket in its
> current state.
> b) If I cannot read the response from the socket after enough time
> has passed, then I consider the request to have failed and I close and
> recreate the socket. I believe this socket resetting to be necessary so
> that the REQ state machine is willing to take writes again.
>
> Does this seem like the right way to go about timeouts?
Great questions. I was wondering the same thing. To add another question in here:
What is the correct way to handle the timeout?
If the REQ socket is in the receive state, the only way it seems to me is to close the socket and make a new socket with a new connection. Is that right?
-Matt.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130719/2f310977/attachment.htm>
More information about the zeromq-dev
mailing list