posicks / mdnsjava

Multicast DNS (mDNS) [RFC 6762] & DNS-Based Service Discovery (DNS-SD) [RFC6763] in Java
http://posicks.github.io/mdnsjava/
110 stars 43 forks source link

New service names are not recognized automatically #16

Closed christophbimminger closed 5 years ago

christophbimminger commented 5 years ago

I registered an RFC 2782 service name ("conecube"). With this service name, I tested the "Registering and Unregistering a Services" sample. But the mDNS implementation throws

Exception in thread "main" org.xbill.DNS.TextParseException: Name "conecube" is not a RFC2782 service name!
    at org.xbill.mDNS.ServiceName.<init>(ServiceName.java:99)
    at org.xbill.mDNS.ServiceName.<init>(ServiceName.java:37)
    at mDnsSampleServer.main(mDnsSampleServer.java:30)

Seems the implementation does not query for registered service names (now listed in a different list than originally maintained for RFC2782 - the new RFC for iana service names is RFC6335 - see https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=conecube)

Using the 2.1.6-SNAPSHOT as suggested in the mdnsjava page's textual description.

I did also review the MASTER/TRUNK version's ServiceName implementation. Here it's searching for a Service.protocol file, which is not contained in the MASTER branch's sources.

posicks commented 5 years ago

This project is an implementation of mDNS using service names as the were defined in RFC2782 using the format "_Service._Proto.Name", e.g, _http._tcp.local, with support for sub protocol support. It does not work with any other service name formats.

After reviewing the link, the proper DNS name for the conecube service should be in the format "_conecube._udp", "_conecube._udp.local." or "_conecube._udp.domain."

That being said, there is no practical reason that any valid DNS name can not be used for service discovery and hence I will investigate the removal of the format limitations or expanding the service name formats allowed.