NSNetServiceBrowser vs. mDNSResponder
NSNetServiceBrowser vs. mDNSResponder
- Subject: NSNetServiceBrowser vs. mDNSResponder
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Fri, 13 Jan 2017 16:40:23 +0700
iOS (10.2) app does:
SERVICE_TYPE = 1 to 63 ascii chars; no spaces; no ‘.’; no ‘[‘; can use ‘_' or '-'; case insensitive
Note: I did not find these rules documented anywhere, they are just the result of trial and error.
fullNameOfServiceType = “_SERVICE_TYPE._tcp."
[ NSNetServiceBrowser searchForServicesOfType: fullNameOfServiceType inDomain: … ];
If SERVICE_TYPE is more than 63 chars, then
-[NSNetServiceBrowserDelegate netServiceBrowser:didNotSearch:] will complain with BadArgument.
Now I see in iOS 10.2 (maybe was there before):
com.apple.mDNSResponder AllINFO
Bad service type in ._GmdEcho890123456._tcp.local. Application protocol name must be underscore plus 1-15 characters. See <http://www.dns-sd.org/ServiceTypes.html>
But it still works.
So:
1. what is the real constraint of SERVICE_TYPE:
1a: underscore plus 1-63 characters (NSNetServiceBrowser)
1b: underscore plus 1-15 characters (mDNSResponder)
2. is this documented anywhere?
Gerriet.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden