[zeromq-dev] automatically choosing a free TCP port

David Robinson zxvdr.au at gmail.com
Mon Mar 15 13:40:35 CET 2010

> The basic use-case would be to announce a service(s) to a network. eg,
> you have an application that consumes something (using zmq_sub or
> zmq_rep) and you don't want to have to tell all the clients how to

So, rereading this it still didn't seem clear. Clearly you will have
to tell the clients how to connect, but I don't want to have to do it
manually. I want the consumer to announce its addr details via avahi
and I want the producer to get those same details from avahi.

> connect to it (eg, the IP address and port number that your zmq based
> app is listening on - the address argument for zmq_bind). You can use
> avahi to tell everything on the network what IP and port your
> application is listening on. The publishing application(s) can then
> feed your consumer because they learned the address details.
> Its basically makes configuration a bit more flexible because you
> don't have to care where your app runs - as long as everything that
> needs to find it can find it you're happy. Avahi will make sure that
> your producers can find your consumers (provided that you've hooked
> them up correctly).

fwiw, I could manually tell the consumer what port to listen on then
use avahi to tell the producer how to connect. I just don't really
want to tell the consumer what port to listen on because I couldn't
care less what port it listens on :-)


More information about the zeromq-dev mailing list