On 13 Jan 2017, at 09:40, Gerriet M. Denkmann <gerri...@icloud.com> wrote:
> 
> 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.

[snip]

> 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?

The 63 character limit is from the DNS, specifically RFC 1035 section 2.3.1, 
which says:

  Labels must be 63 characters or less.

This applies to each label in a domain name.

The 15 character limit is specific to SRV records and comes from RFC 6763, 
section 7.2, which says:

  The Service Name <sn> may be up to 15 bytes, plus the underscore…

I don’t know if *Apple* has documented these anywhere in its documentation, but 
they are certainly in the relevant RFCs.

Kind regards,

Alastair.

--
http://alastairs-place.net


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to