JmDNS, JmmDNS? what is the difference? what to use in my bundle?
I'm a newbie here. While having a look on the JmDNS library (3.4.1), I couldn't clearly get the difference between JmDNS and JmmDNS instances. I used an instance of JmmDNS to discover services and it works properly in my application. Then, I wanted to transform my code into a bundle, however, nothing works.Then, if I use an instance of JmDNS in my bundle, I can discover the services successfully. I would be grateful if someone make this clearer for me. Also, according to documentation, with JmmDNS we have a NetworktopologyListener so we guarantee that the services are always updated. Is this guaranteed also with JmDNS instances? I'm hesitating 开发者_JAVA百科to use my bundle for this reason (services may be not updated with changes in network)
Thanks for your help
If you look at the documentation, the class documentation for JmmDNS says:
Java Multihomed Multicast DNS
Uses an underlying JmDNS instance for each InetAddress found on this computer.
This class will monitor network topology changes, and will create or destroy JmDNS instances as required. It is your responsibility to maintain services registration (hint: use a NetworkTopologyListener).
A JmDNS
instance is bound to a specific Interface
and does everything required to maintain an mDNS responder on that single interface, including service discovery and announcement.
FWIW, I ended up writing my own NetworkTopologyListener
and JmmDNS
work-alike because the ones supplied did not work very well in my experience. Interface discovery did not work at all in some JVM v7 versions on early Windows 7 and it got confused with mixed IPv4 and IPv6 situations. Those two were experimental at the time.
精彩评论