NSURLConnection and buffering
NSURLConnection and buffering
- Subject: NSURLConnection and buffering
- From: "Arvind Jain" <email@hidden>
- Date: Fri, 4 Jul 2008 01:34:46 -0700
I'm using NSURLConnection to download a web page which is served from a
server that uses HTTP 1.1 and chunked encoding. The web page consists of 2
sections; the server sends the first section which is about 300 bytes
immediately, and has to do some processing for 30 seconds before it sends
the next chunk which is larger (10KB).
I'd like to display the first 300 bytes immediately, but my delegate method
connection::didReceiveData is not called until after the second chunk is
sent by the server (that is 30 seconds later). It appears there is a minimum
buffer size in the NSURLConnection class - it won't give the bytes to me
until it has accumulated that many bytes.I verified this by increasing the
size of the first chunk. If is is 2KB or so, then I get the didReceiveData
call right after the server has sent the first chunk.
I noticed that Safari on Macbook pro has the same behavior. It won't render
the first chunk until after the second one is sent.
Any way to tell NSURLConnection to not buffer and send me bytes immediately?
Arvind
_______________________________________________
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