mjansson / mdns

Public domain mDNS/DNS-SD library in C
The Unlicense
437 stars 117 forks source link

Domain name irregularities #46

Closed ben-sedg closed 3 years ago

ben-sedg commented 3 years ago

Issue: ./mdns --service _bensservice._tcp.local --hostname bens_hostname --port 1234 ./mdns --query _bensservice._tcp.local

The above commands will not be able to receive a response for my query. I think the issue has something to do with a period being added to the end of service names. So the above name will become "_bensservice._tcp.local." I did not see any requirement for domain names to end in .local. (ending with period).

It seems i am only able to success if i run my host service as: ./mdns --service _bensservice._tcp.local. --hostname bens_hostname --port 1234

Is this an mDns requirement i am missing, or a bug in the code?

mjansson commented 3 years ago

It was just the example application that assumed the given service name ended in a dot. It has now been corrected (the actual mDNS implementation in mdns.h was not affected).