Re: iPhone Testing Internet Connection?
Re: iPhone Testing Internet Connection?
- Subject: Re: iPhone Testing Internet Connection?
- From: Markus Spoettl <email@hidden>
- Date: Tue, 15 Dec 2009 19:30:58 +0100
On Dec 15, 2009, at 6:20 PM, David Duncan wrote:
> Don't use Reachability synchronously. At some point you will be blocked, you will hit a watchdog timer, and your application will be killed.
I find that a little misleading. It seems to depend on how you use the API. If you check for a specific host name that is certainly true, but if you just check for the presence of a network the response is quick.
The Readme of the Reachability sample states:
>>>>
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.
<<<<<
I'm only posting this because after suffering a minor heart attack reading your post I thought it might be interesting for other readers as well.
Regards
Markus
--
__________________________________________
Markus Spoettl
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden