[zeromq-dev] RFC: PPPP - Paranoid Pirate Publishing Protocol

Goswin von Brederlow goswin-v-b at web.de
Tue Jul 1 16:46:45 CEST 2014

On Mon, Jun 30, 2014 at 05:12:08PM +0200, Pieter Hintjens wrote:
> CURVE works over all socket types, when using TCP or IPC (not when using PGM).
> On Mon, Jun 30, 2014 at 3:48 PM, Goswin von Brederlow <goswin-v-b at web.de> wrote:
> > Hi,
> >
> > I came up with an extension to the Paranoid Pirate Protocol [4] for
> > use in a PUB/SUB pattern. The protocol should work with ROUTER/DEALER
> > or XPUB/XSUB sockets I hope. With ROUTER/DEALER the publisher has to
> > manage sending messages to all peers itself, with XPUB/XSUB zmq will
> > handle that part. With ROUTER/DEALER the resends can be more
> > specifically targeted.
> >
> > Questions:
> > - Would this work with epgm?
> > - Does XPUB/XSUB work with CURVE?
> >
> > MfG
> >         Goswin

I've run into 2 problems trying to implement this:

1) with ROUTER/DEALER I don't get a message when a subscriber
disconnects without unsubscribing.

Eventualy the heartbeat will get it but that can take a long time and
a lot of messages can queue up inbetween for no good reason.

So I tried using a monitor socket. But that only gives me the FD and
address of the receiving socket:

  EVENT_DISCONNECTED: 13 on b'tcp://'

So how do I find out that FD 13 belongs to peer xyz?

2) with XPUB/XSUB the CURVE metadata seems to get lost

zmq_msg_gets() always returns Null it seems. I think the problem is
that zmq::xpub_t::xread_activated just appends the message data to its
internal std::deque. A ROUTER socket on the other hand attaches the
pipe to its fair queue.

Should this be rewritten to use a fair queue too?


More information about the zeromq-dev mailing list