nw_resolver_create_dns_service_locked

2017-10-16 22:28:23.640799+0800 ReaderForMac[9283:362871] dnssd_clientstub ConnectToServer: connect()-> No of tries: 1

2017-10-16 22:28:24.648024+0800 ReaderForMac[9283:362871] dnssd_clientstub ConnectToServer: connect()-> No of tries: 2

2017-10-16 22:28:25.656081+0800 ReaderForMac[9283:362871] dnssd_clientstub ConnectToServer: connect()-> No of tries: 3

2017-10-16 22:28:26.662732+0800 ReaderForMac[9283:362871] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:11 Err:-1 Errno:1 Operation not permitted

2017-10-16 22:28:26.663066+0800 ReaderForMac[9283:362871] [] nw_resolver_create_dns_service_locked DNSServiceCreateConnection failed: ServiceNotRunning(-65563)

2017-10-16 22:28:26.669099+0800 ReaderForMac[9283:362827] Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={NSUnderlyingError=0x600000249990 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorCodeKey=-72000, _kCFStreamErrorDomainKey=10}}, NSErrorFailingURLStringKey=http://www.qq.com/, NSErrorFailingURLKey=http://www.qq.com/, _kCFStreamErrorDomainKey=10, _kCFStreamErrorCodeKey=-72000, NSLocalizedDescription=A server with the specified hostname could not be found.}


OS 10.12.6

Xcode9

**** using Xcode8.3 is ok

The key line in the log you posted is this one:

2017-10-16 22:28:26.662732+0800 ReaderForMac[9283:362871] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:11 Err:-1 Errno:1 Operation not permitted

The DNS resolver library in your process (

dnssd_clientstub
) is being barred from connecting to the UNIX domain socket (
/var/run/mDNSResponder
) that it uses to talk to the system-wide resolver daemon (
mDNSResponder
). The most common cause for that problem on macOS is the App Sandbox. If your app is sandboxed make sure it’s signed with the
com.apple.security.network.client
entitlement.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Is there a reason for this on watchOS?

I'm having this exact problem on watchOS 6.1 when using NWBrowser.

watchOS does not, in general, support low-level networking (most apps are limited to HTTP[S] and above). Ignoring this error for the moment, what do you plan to do with the results from

NWBrowser
?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I am curious about this statement as I am having problems with NSBrowser on watchOS 6 and would expect it to work based on Advances In Networking part 2 from WWDC 2019 where it is proclaimed that Bonjour is available on all native platforms (start at 1 min 15 seconds into the video).


Personally, I am attempting to connect to an iPad that is broadcasting data that the watch can't get or produce, but would make an excellent display of that data.

watchOS only supports low-level network in the context of audio stream apps. So, while the Network framework is available on watchOS, it’s only useful if you happen to be stream audio.

See WWDC 2019 Session 716 Streaming Audio on watchOS 6 for more background on this.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
nw_resolver_create_dns_service_locked
 
 
Q