A JmDNS / mDNSResponder Zeroconf Compatibility Interface

My company has given me permission to release a Java Zeroconf API. The advantage of this API is that it allows the application to select which implementing library to use at runtime, and eases developer work implementing mDNS / DNS-SD. I also think my API is easier to understand than the raw interfaces of the underlying implementations.

Currently there are two implementing backends, one for JmDNS and one for Apple’s mDNSResponder. I would really like to see one written for Avahi, but I probably won’t get to it myself.

The API is in the org.jmdns.api package, which both implementations are in the org.jmdns.impl package. A unit test is also included which demonstrates usage and verifies operation.

I’ve implemented this version within the JmDNS source tree, but ideally the API, JmDNS and mDNSResponder portions of the code would be broken out to be separately distributed, with the JmDNS and mDNSResponder portions functioning as plugins implementing the API.

I’ve only tested this against mDNSResponder 107.5. I’m not sure if Apple’s dnssd.jar is compatible with newer mDNSResponder versions or not.

You can download the full implementation here: jmdns-kiva-1.1.3.tar.bz2

I hope the JmDNS project will pick this effort up and incorporate this into the official release!

About admin

A software architect and engineer with a fine arts background. You can connect with him on Google+.
This entry was posted in Tech and tagged , , , , , , , , . Bookmark the permalink.

2 Responses to A JmDNS / mDNSResponder Zeroconf Compatibility Interface

  1. Pingback: offTheHill » How To use the Java mDNS Wrapper

  2. indra says:

    I registered some service with subttypes on my linux pc using apple bonjour mdnsresponder .
    $dns-sd Jon _myNet._tcp.,_netone . 9000

    and I tried to browse that on my android phone using jmdns.3.4.1.jar file ( http://jmdns.sourceforge.net/ )
    Map httpsub = jmdns.listBySubtype(”_smartplace._tcp.local.”, 6); System.out.println( “ Subtype SIZE ::: + httpsub.size() “Resolve ::: “ httpsub.get(”_netone”).toString()) ; // I have reigstred only one subtypes service so printing only one

    here is the out for is Subtype SIZE ::: 1 Resolve :::null

    from the link1 , at page 22 the RFC discuss that , It is required to browse the by subtypes in case of specifically browsing for the particular service to find the subset of it , it helps to find the particular service instead browsing all .

    In our case jmdns browse for all the subset of service type and list them in the map, I feel this is a over head for the client , becoz client does not need to bother for the services with different subset .. in this case jmdns is bit uncompatible for this kind of service browse .

    above is my understanding , pls any one correct me if I have misunderstood ..

    And if this is correct then it seems the subdomain is really absent from the service description within jmdns (so it is probably a real bug).

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>