Re: An API for Airplane mode on iOS?
Re: An API for Airplane mode on iOS?
- Subject: Re: An API for Airplane mode on iOS?
- From: Jens Alfke <email@hidden>
- Date: Tue, 09 Feb 2016 12:37:39 -0800
> On Feb 9, 2016, at 10:38 AM, Alex Zavatone <email@hidden> wrote:
>
> Simply put, if we can detect that this user is has turned off Airplane mode, we can respond in a more cautious manner.
But you can run into the same behaviors if the user has turned WiFi and/or cellular off and then back on. The Airplane Mode switch is just a ‘macro’ that turns WiFi, cellular and Bluetooth off (or back on) at once. You can also get race conditions if the device has been away from WiFi and then comes in range of a network that takes a little while to negotiate. (Usually if you’re listening for reachability of a specific host, you won’t hit these in-between states, though.)
The way we deal with this is to retry HTTP requests, if they fail with some common transient IP-level errors like ‘no route to host’ or ‘connection reset by peer’. The retry delay doubles after each failure, and most types of requests give up after 3 failures, so the delays are like 1, 2, 4 seconds.
—Jens
_______________________________________________
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