[zeromq-dev] Q: socket type/pattern for protocol exchange

Pieter Hintjens ph at imatix.com
Mon Jun 10 11:05:33 CEST 2013


On Mon, Jun 10, 2013 at 9:33 AM, Michael Haberler <mail17 at mah.priv.at> wrote:

> I am about to implement a protocol between peers; the phases and interactions being roughly:
>
> - an negotiation phase (peers exchange options and reach agreement or dont)
> - an 'open' phase entered on agreement, where state updates flow either direction as needed, not necessarily requiring confirmation
> - a shutdown phase initiated by either side
>
> Potentially there might be more than two peers. Message flows and encoding are done (protobuf).

It's a fairly common use case and I'd tend to recommend an asymmetric
protocol with ROUTER at the "server" and DEALER at the "client"; there
are examples of this in the Guide, especially Chapter 7. If you want a
symmetric network you can try the Harmony pattern from Chapter 8.

-Pieter



More information about the zeromq-dev mailing list