#10 Built-in support for multiple network interfaces


There are two related problems I have noticed:
* If you have a machine with two network interfaces (lately a large number of motherboards have started to come with dual network ports), JmDNS' default factory method may pick the wrong one.
* Even if you only have one physical network interfaces, installing VMware can often result in the same symptom.

The current workaround for this is to create one JmDNS per interface, and manage all of them -- when you need to publish a ServiceInfo you need to publish it on all of them, and what happens if two of them are actually on the same network? Presumably hell breaks loose, although I am yet to find out.

Unfortunately this workaround is not very simple, as ServiceInfo does contain the IP address so you actually wind up adding multiple independent ServiceInfo records to advertise the existence of a single host.

It would be nice if JmDNS itself would provide the built-in ability to listen on multiple interfaces, or at the very least multiple IP addresses, such that we can pass in a list of NetworkInterface or a list of InetAddress, and have it Do The Right Thing [TM]. Ideally it would also need to support adding and removing interfaces at run-time, as realistically the state of the network does change at runtime.


  • Cédrik

    Cédrik - 2010-09-30

    This would indeed remove a lot of boiler-plate code from our code.
    Please note that you /must/ create a different ServiceInfo instance for each JmDNS registration you make. I've been hit by this "bug" once, so maybe it would be wise to add some JavaDoc to the ServiceInfo class...
    I'll try to work on a patch if I can find some free time.

  • Pierre Frisch

    Pierre Frisch - 2010-10-21

    Built-in support for multiple network interfaces - ID: 3079530

  • Pierre Frisch

    Pierre Frisch - 2010-10-21
    • assigned_to: nobody --> spearway
    • status: open --> pending
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

  • SourceForge Robot

    • status: pending --> closed