Re: CFReadStreamCopyProperty() returns NULL?
Re: CFReadStreamCopyProperty() returns NULL?
- Subject: Re: CFReadStreamCopyProperty() returns NULL?
- From: Jens Alfke <email@hidden>
- Date: Sun, 8 Feb 2009 14:35:50 -0800
On Feb 8, 2009, at 1:58 PM, John Michael Zorko wrote: NSURLConnection caches data and doesn't let me, the developer, control how much I read from the socket. This led to huge memory usage in my iPhone app, as NSURLConnection would happily read way ahead into the stream and cache it, causing the iPhone OS to send my app low memory warnings. Oh, you must be streaming then. You're right, I don't think it's possible to throttle the rate at which NSURLConnection reads data.
The docs for CFReadStreamOpen say:
Sounds like you'll need to wait for a response to arrive. Scheduling with a runloop is usually preferable; it's the expected Way Things Are Done in Cocoa/CFNetwork, and it saves you from having to spawn a new thread just to read from the stream.
—Jens
|
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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