Re: backgrounding a udp socket
Re: backgrounding a udp socket
- Subject: Re: backgrounding a udp socket
- From: Adam Kaplan <email@hidden>
- Date: Fri, 11 Sep 2015 11:35:12 -0400
Just an additional update on what I suggested earlier:
I whipped up a quick prototype for my suggestion. Beyond “no special support for UDP”, iOS actively refuses to do anything but HTTP/S in a background-configured NSURLSession (even while it is in the foreground). This means that custom protocols are not supported in the fully above board NSURL background stack, and you’ll need to use the less flexible -beginBackgroundTaskWithName:expirationHandler: mode.
— adam
On Friday, September 11, 2015 at 3:35 AM, Quinn "The Eskimo!" wrote:
>
> On 11 Sep 2015, at 00:32, Michael Brian Bentley <email@hidden (mailto:email@hidden)> wrote:
>
> > Is it possible to set up a udp socket via a background task using
> >
> > -beginBackgroundTaskWithName:expirationHandler:
> >
> > (or something like it) such that we're able to continue receiving datagrams while the app is backgrounded?
>
> The advice from Technote 2277 "Networking and Multitasking" still applies.
>
> <https://developer.apple.com/library/ios/#technotes/tn2277/_index.html>
>
> iOS has no special support for UDP networking in the background, so the only way to do this is to prevent your app from suspending (-beginBackgroundTaskWithName:xxx is one way to do that).
>
> There's good news and bad news on that front:
>
> * The good news is that, if you prevent your app from suspending, there's no difference between networking in the background vs the foreground.
>
> * The bad news is that the system puts strict limits on how long you can run in the background (to preserve device standby time).
>
> Share and Enjoy
> --
> Quinn "The Eskimo!" <http://www.apple.com/developer/>
> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Macnetworkprog mailing list (email@hidden (mailto:email@hidden))
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden (mailto:email@hidden)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden