[zeromq-dev] using REQ in a real application
Justin Karneges
justin at affinix.com
Fri Jul 19 04:56:02 CEST 2013
On 07/18/2013 04:09 PM, Steven McCoy wrote:
> On 18 July 2013 16:43, Matt Connolly <matt.connolly at me.com
> <mailto:matt.connolly at me.com>> wrote:
>
> 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?
>
>
> Yes, REQ and REP are pretty much "L-plate
> <http://en.wikipedia.org/wiki/L-plate>" sockets but also incredibly
> useful for rapid prototyping of environments. Heading towards
> production you want to replace with DEALER and ROUTER to remove the
> fatal blocking states.
If that's true, it's not something I recall being at all clear from the
guide. It sounds like there are some fixes in the right direction on zmq
master at least. Maybe having the state reset itself on every write
would be enough for REQ to be used in production without any hacks.
Also, I don't think there's any issue with REP is there? One could use
REP for a server and DEALER for a client without any gotchas.
Justin
More information about the zeromq-dev
mailing list