iOS4: CFReadStream and background operation
iOS4: CFReadStream and background operation
- Subject: iOS4: CFReadStream and background operation
- From: John Michael Zorko <email@hidden>
- Date: Tue, 22 Jun 2010 17:21:22 -0700
Hello, all ...
I've an app that reads from the network using CFReadStream (it needs to use CFReadStream so that it can throttle the connection and specify how many bytes to read each time). What i'm finding is that CFReadStream callbacks aren't always called when the app is in the background. Specifically, what I _seem_ to be seeing is this:
1. CFReadStreams created when the app was in the foreground continue (the CFReadStream callback is called) when the app is put in the background.
2. However, CFReadStreams created _while_ the app was in the background often (though not always) _don't_ call their callbacks _until_ the app is brought in the foreground, then all of a sudden the callback happens.
The app in question is set up for background operation and runs in the background when the user presses the home button -- I can put a breakpoint in my thread's run loop and see this -- but the CFReadStream callback doesn't always get called, which makes this app appear to stop until the user brings it in the foreground again.
Thoughts? If anyone could assist and help me understand why this happens (and how to fix it), i'd be quite appreciative :-)
Regards,
John
_______________________________________________
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