> On Feb 23, 2015, at 4:20 PM, Rick Mann <[email protected]> wrote: > > I thought I've read in the past that we shouldn't use SCNetworkReachability > to determine reachability, but to actually just try to connect to our > servers, and if that fails, then do something. > What is that something? Looking at the SCNetworkReachability Reference, > there's no mention of this usage.
We’ve been struggling with this too. As far as I know, the basic logic is that if the failure "looks like" it could be caused by an unreachable host, set a timer and retry periodically (probably with an exponential backoff.) Meanwhile, run a reachability observer, and if it’s told that the host became reachable, abort the timer and retry right now. The “looks like” test seems to be a heuristic where you check various error codes in various NSError domains. The ones we look for currently are NSURLErrorDNSLookupFailed, NSURLErrorNotConnectedToInternet, NSURLErrorInternationalRoamingOff; but my colleague who’s working on this problem has probably added a few more that I haven’t seen yet… —Jens
_______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com This email sent to [email protected]
