[zeromq-dev] Publish / Subscribe vs Multicast

Martin Sustrik sustrik at 250bpm.com
Tue Feb 16 14:02:30 CET 2010


Hi Gonzalo,

> Martin, all I see in the attached PNG is seven white squares on a black
> background, with no other markings.

It corresponds to the diagram in butterfly example that I've linked you 
to originally:

http://www.zeromq.org/tutorials:butterfly#toc7

> Yesterday, driving home, I convinced myself that what I am doing is not
> going to work (which probably means that I will have to convince myself
> later that I was wrong about it not working...). Anyway, from what I
> know about TCP/IP, you can bind only one socket to a given IP address /
> port, right? Therefore, how would it be possible to have several
> instances of component1, all bound to the same endpoint, running at the
> same time?

That's what 0MQ does for you. Single 0MQ socket handles arbitrary number 
of unerlying TCP sockets.

> Furthermore, let's say this multiple binding is made possible by zmq.
> When send_requests sends a request, how will it know there are two,
> three or N instances of component1, all bound to the same destination
> endpoint, so that send_requests will round-robin between them?

It knows because component1 instances connects to send_requests.

Maybe reading the article published recently at LWN would help you to 
get soume background?

http://lwn.net/Articles/370307/

Martin



More information about the zeromq-dev mailing list