NetService can't resolve(withTimeout:) service connected via ethernet for iOS 17.1+ (NSNetServicesErrorDomain: 10, NSNetServicesErrorCode: -72007)

It worked fine before iOS 17.1. Just checked with iOS 16 on real device. And my teammate from QA department confirmed it works for iOS 17.0.1. The problem occurs only with device in local network connected via ethernet. The device itself has two options for connection - via Wi-Fi and Ethernet. It works for all iOS versions via Wi-Fi. But it can't resolve host for Ethernet connection.

Error appears in

func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber])

looks like that:

(NSNetServicesErrorDomain: 10, 
NSNetServicesErrorCode: -72007)

Could you please explain this error code?

Replies

Could you please explain this error code?

The explanation of this error code is very simple: It’s defined in the header as NSNetServicesTimeoutError and it means that the Bonjour resolve operation could not be completed within the specified timeout.

Sadly, that doesn’t really help you very much, because the obvious next question is “Why did it fail?” Honestly, this sounds like a bug to be but before I send you off in that direction I’d like you to try replicating this with a non-deprecated API. And before I can do that I need to understand why you’re resolving this service. Do you plan to connect to it using TCP? Or are you resolving it for some other reason, for example, to form a URL that you pass to a web view?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"