IMPORTANT: Reachability must use DNS to resolve the host name before it |
can determine the Reachability of that host, and this may take time on |
certain network connections. Because of this, the API will return |
NotReachable until name resolution has completed. This delay may be |
visible in the interface on some networks. |
|
The Reachability sample demonstrates the asynchronous use of the |
SCNetworkReachability API. You can use the API synchronously, but do not |
issue a synchronous check by hostName on the main thread. If the device |
cannot reach a DNS server or is on a slow network, a synchronous call to |
the SCNetworkReachabilityGetFlags function can block for up to 30 |
seconds trying to resolve the hostName. If this happens on the main |
thread, the application watchdog will kill the application after 20 |
seconds of inactivity. |