> On Feb 9, 2016, at 4:02 PM, Jens Alfke <j...@mooseyard.com> wrote:
> 
> 
>> On Feb 8, 2016, at 9:45 PM, Glenn L. Austin <gl...@austinsoft.com> wrote:
>> 
>> According to the docs on Reachability (possibly lost in the mists of 
>> time...), Reachability isn't really designed to tell you whether your net 
>> access *will* succeed, but to give you reasons that your last access 
>> *failed.*
> 
> It’s not that surprising. There’s no guarantee that any IP packet will make 
> it across the network, and no way to tell whether a host really is reachable 
> without actually sending a packet to it (and back.) So the only way 
> Reachability could tell you an access *will* succeed would be if it were 
> constantly pinging the server, which is obviously impractical.
> 
> All Reachability tells you is whether there is an active network interface 
> that can be used to route a packet one hop toward the desired host.
> 
> ―Jens
> ______________________________ 

Indeed. 
I like to call this "The Truth About Sockets", or "It Would Be Nice If Apple 
and Other API Vendors Just Shared Precisely What They Do To Determine Which 
User Friendly Network-Related Error Message To Present To Users In Their Apps"

Safari as an example does try the connection first. Apple recommends this. 
After a failure or three it is good to attempt a reasonable explanation to the 
user. 
Pretty easy to determine if you're getting loop back or no initial hop.
A little fancier to look at getting more hops but destination server not 
responding. 
Really more work to understand when you're connected to a captive network but 
not authenticated and try to let users know or to deal with cellular data 
turned off for an app and not know. 

In the end the first step is always the same. 
Try to connect first. 
Even the venerable Beej's Guide to Sockets says this. 


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to