Re: NSNetService returning NSNetServicesBadArgumentError
Re: NSNetService returning NSNetServicesBadArgumentError
- Subject: Re: NSNetService returning NSNetServicesBadArgumentError
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Wed, 27 Jul 2011 08:27:55 +0100
On 27 Jul 2011, at 02:23, Rick Mann wrote:
> I have working code that uses @"" (PictureSharing sample).
Passing @"" will advertise the service in all appropriate domains, where the definition of "appropriate domains" is configuration specific. In a typical user scenarios it includes:
o the local domain
o if the user has Back To My Mac enabled, their BTMM domain
I'm surprised you had to make this change to get things to work. I tested your setup here (with the type fix) and I saw exactly what I expected:
1. First advertise the service in "".
$ python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from Foundation import *
>>> ns = NSNetService.alloc().initWithDomain_type_name_port_("", "_MAVLink._tcp", "Foo", 12345)
>>> ns.publish()
2. In another Terminal window, browse for the service in the local domain.
$ dns-sd -B _MAVLink._tcp local
Browsing for _MAVLink._tcp.local
Timestamp A/R Flags if Domain Service Type Instance Name
8:24:15.871 Add 3 5 local. _MAVLink._tcp. Foo
8:24:15.871 Add 3 7 local. _MAVLink._tcp. Foo
8:24:15.871 Add 2 8 local. _MAVLink._tcp. Foo
^C
3. Now browse for the service in the "" domain.
$ dns-sd -B _MAVLink._tcp ""
Browsing for _MAVLink._tcp
Timestamp A/R Flags if Domain Service Type Instance Name
8:25:00.578 Add 3 5 local. _MAVLink._tcp. Foo
8:25:00.581 Add 3 7 local. _MAVLink._tcp. Foo
8:25:00.581 Add 2 8 local. _MAVLink._tcp. Foo
8:25:02.869 Add 2 0 redacted.members.mac.com. _MAVLink._tcp. Foo
^C
Note that we find the service in both local and my BTMM domain.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden