[zeromq-dev] Publish / Subscribe vs Multicast

Martin Sustrik sustrik at 250bpm.com
Tue Feb 16 15:38:09 CET 2010


gonzalo diethelm wrote:
>> Hola Gonzalo,
> 
> Hey, that was quick! Do you speak Spanish?

I've used to. Comprendo castellano pero mis respuestas seran 
completamente a-gramaticas :)

> BTW, at least some of you guys are located in Switzerland, right?

I am based in Slovakia. Other guys on the mailing list are located 
elsewhere.

>> Ok. I see. You are doing it other way round. The rule of the thumb is:
>> The endpoint that should handle multiple connections (server) should
>> bind, while the one that handles only a single connection (client)
>> connects.
>>
>> So, in your case, sender should bind and receiver should connect.
> 
> Did that, same results. Reattaching the files. I did double check to
> make sure I deleted the binaries and recompiled.

Ok. Tried it. There are several problems with the sample:

1. Sender terminates immediately after all messages are sent from the 
API. Actual pushing of the messages to the network is asynchronous so if 
there are messages queued in the sender process at the time when process 
is terminated these will be lost. You can fix this by sleeping for a 
while before exiting.

2. Individual receivers won't connect at exactly the same time, so if 
you are sending just couple of messages it's quite probable that all the 
messages will be sent to the receiver which happens to connect the first.

Other than that the sample seems to work OK here.

Martin





More information about the zeromq-dev mailing list