SCNetworkReachabilityCreateWithName not working for all URLs

SCNetworkReachabilityCreateWithName(NULL, "www.google.com") does work fine,

SCNetworkReachabilityCreateWithName(NULL, "https://domino.ese-edu.com") or

SCNetworkReachabilityCreateWithName(NULL, "https://scanner.ese-edu.com:50443")


Always fails although both URLs hit a working and responding server.


Are there any special communication (port?) requirements for this function to work?

Replies

You’re not supposed to pass URLs to

SCNetworkReachabilityCreateWithName
; it takes a DNS name. So your second example should be:
SCNetworkReachabilityCreateWithName(NULL, "domino.ese-edu.com")

Share and Enjoy

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

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