• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: backgrounding a udp socket
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: backgrounding a udp socket


  • Subject: Re: backgrounding a udp socket
  • From: Adam Kaplan <email@hidden>
  • Date: Thu, 10 Sep 2015 21:39:42 -0400

There is already support for backgrounded network connections via NSURLSession. I would stay within the process provided by NSURLSession and try not to subvert it.

It sounds like what you want is to model the behavior of your proprietary UDP protocol in an NSURLProtocol subclass. Once your protocol handler is properly registered (via +registerClass), you should be able to use vanilla NSURLSession background task methods to do what you want.

These might help:

http://nshipster.com/nsurlprotocol/

https://developer.apple.com/library/prerelease/ios/documentation/Cocoa/Reference/Foundation/Classes/NSURLProtocol_Class/index.html

https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/URLLoadingSystem/Articles/UsingNSURLSession.html

Disclaimer: I have written iOS UDP clients & servers, and done background networking, but never both at the same time :)

— adam


On Thursday, September 10, 2015 at 7:32 PM, Michael Brian Bentley 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?
>
> -Mike
> _______________________________________________
> 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


References: 
 >backgrounding a udp socket (From: Michael Brian Bentley <email@hidden>)

  • Prev by Date: Re: Need advice about [NSInputStream read:maxLength:] performance.
  • Next by Date: Re: backgrounding a udp socket
  • Previous by thread: backgrounding a udp socket
  • Next by thread: Re: backgrounding a udp socket
  • Index(es):
    • Date
    • Thread