[zeromq-dev] automatically choosing a free TCP port

David Robinson zxvdr.au at gmail.com
Mon Mar 15 15:36:30 CET 2010


>> Fair enough! We've been discussing this scenario, thinking more of DNS
>> as a provider of routing info...
>
> FYI, see this thread for the proposal on locating services via DNS:
>
> http://lists.zeromq.org/pipermail/zeromq-dev/2010-January/001807.html

Interesting... fwiw the simple static file that was proposed is quite
similar to what avahi uses for static DNS-SD service data. Here's what
was proposed:

<locator>
  <service name = "feed1">
    <connect addr = "tcp://10.10.10.1:5555" />
    <!-- for failover -->
    <connect addr = "tcp://10.10.11.1:5555" />
    <!-- for services binding to this name as opposed to connecting -->
    <bind addr = "tcp://eth0:5555" />
  </service>
</locator>

and here's what avahi has sitting in /etc/avahi/services/ssh.service on my pc:

<service-group>
  <name replace-wildcards="yes">%h</name>
  <service>
    <type>_ssh._tcp</type>
    <port>22</port>
  </service>
</service-group>

iirc the 169.254. IP addresses are for multicast DNS. I suspect DNS-SD
could be used without multicast DNS and that would give at least half
a solution.

I'll see if I can find some time to investigate this further. It may
end up that avahi doesn't meet my needs wrt playing nicely in HA (like
what was mentioned before about restarting on a different port).

-Dave



More information about the zeromq-dev mailing list