[zeromq-dev] ROUTER/PULL

Pieter Hintjens ph at imatix.com
Wed Nov 14 03:15:09 CET 2012

On Wed, Nov 14, 2012 at 10:50 AM, Justin Karneges <justin at affinix.com> wrote:

> Well, or use a separate socket for inbound communication. My application
> receives from one socket and sends to another.

How do you know the identity of the PULL socket you're sending to? The
ROUTER socket does not work well with purely outbound communications.
There are several aspects:

* You need to invent and manage your own identities
* You have no way of knowing when the connection is actually live
* When sending, and connection is not live, messages are silently dropped
* You have no way to heartbeat the connection, so cannot detect failures

You've not identified any problem with using DEALER except "it's not
PULL", which seems arbitrary. You can literally replace ZMQ_PULL with
ZMQ_DEALER in your code and it will work the same.

The best way to use ROUTER sockets, from experience, is as response
sockets: initiate the dialog from the peer.


More information about the zeromq-dev mailing list