[zeromq-dev] pub/sub and multicast
Greg Ward
greg at gerg.ca
Thu Jul 24 20:36:30 CEST 2014
On 23 July 2014, McMillan, Scott A said:
> Hi,
>
> Sorry for the very basic question, I'm new to zeromq.
>
> The FAQ (http://zeromq.org/area:faq#toc0) says "PUB does multicast." How
> should I interpret this statement? Does this mean that IP-level multicast
> is required to use the pub/sub pattern?
Have you read the guide (http://zguide.zeromq.org/)? Have you compiled
and run the examples there?
Short answer: pub/sub works just fine over TCP. I believe it also
supports IP multicast for use at large scale, but I personally haven't
had the need to do that.
> Looking at the examples, it looks like the protocol can be selected
> independently from the pattern? E.g., several examples contain the
> following, which I interpret as the pub/sub pattern on top of TCP unicast:
>
> void *publisher = zmq_socket (context, ZMQ_PUB);
> zmq_bind (publisher, "tcp://*:5563");
Correct.
> If one wanted to use multicast, then the second line would be replaced
> with something like:
>
> zmq_bind (publisher, "pgm://...");
>
> Am I understanding this correctly?
Have you *tried* it? It's example code, it's supposed to work for you
in a test environment. Give it a shot!
Greg
More information about the zeromq-dev
mailing list