[zeromq-dev] REQ/REP for possibly async comm?

Chuck Remes lists at chuckremes.com
Fri Mar 30 15:15:13 CEST 2012


On Mar 30, 2012, at 7:04 AM, Schmurfy wrote:

> When you need asynchronous communication you better use ROUTER/DEALER than REQ/REP, the only time I may want
> to use a REQ socket is to write a simple client taking to a server using a ROUTER socket.
> Except that I am still wondering why would anyone use REP/REQ given its limitations for anything serious, I think it takes
> too many assumptions that everything will work as expected which rarely happens in a real use case.

I think the main use-case for REQ/REP is to use it to communicate within a single thread (via inproc). It can simplify some communications.

As soon as you introduce a second thread (or another process) there is the possibility of failure, so REQ/REP becomes less useful. In those cases I almost always use DEALER/ROUTER.

cr





More information about the zeromq-dev mailing list