• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSNetServiceBrowser vs. mDNSResponder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSNetServiceBrowser vs. mDNSResponder


  • Subject: Re: NSNetServiceBrowser vs. mDNSResponder
  • From: Alastair Houghton <email@hidden>
  • Date: Fri, 13 Jan 2017 18:23:23 +0000

On 13 Jan 2017, at 09:40, Gerriet M. Denkmann <email@hidden> 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 (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


References: 
 >NSNetServiceBrowser vs. mDNSResponder (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: What do NSArrayController, etc. do for me?
  • Next by Date: Re: Seeing nil passed to isEqual:, despite non-null declaration
  • Previous by thread: Re: NSNetServiceBrowser vs. mDNSResponder
  • Next by thread: What do NSArrayController, etc. do for me?
  • Index(es):
    • Date
    • Thread