On Jun 2, 2011, at 1:44 PM, Jim Adams wrote: > True. But the situation we were running into was that a server might not be > up and I could tell faster with ping than a timer.
The point (that others have already made) is not that ping is fast, but that (a) a successful ping doesn't tell you if your server will respond to your actual request, and (b) the server might go down between a successful ping and the actual request. If it takes too long, just set a lower value for the timer. Especially in the mobile world, there's an awful lot that can change between two requests, so preflighting the request is just a waste of a connection. > -----Original Message----- > From: David Duncan [mailto:david.dun...@apple.com] > Sent: Thursday, June 02, 2011 1:37 PM > To: Jim Adams > Cc: cocoa-dev > Subject: Re: What is the point of a host-reachability test that doesn't test > the reachability of the host? > > On Jun 2, 2011, at 10:31 AM, Jim Adams wrote: > >> Why? Because the timeout was inordinately long with no way to shorten it >> other than create my own timeout. Users want responsiveness. One of the >> things I hate more than anything is when an app won't start because it can't >> contact its host. Its bad enough if it can contact the host but the response >> is really slow. > > > If you want to create your own timeout, all you should have to do is start > the (asynchronous) connection and set a timer for the timeout length you > desire. If you don't get a response by then (presumably you just cancel the > timer if you do) then you cancel the connection attempt and declare that the > connection timed out. No need for additional connections. > -- > David Duncan _______________________________________________ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com