Re: NSURLConnection and buffering
Re: NSURLConnection and buffering
- Subject: Re: NSURLConnection and buffering
- From: "Michael Ash" <email@hidden>
- Date: Fri, 4 Jul 2008 19:22:30 -0400
On Fri, Jul 4, 2008 at 4:34 AM, Arvind Jain <email@hidden> wrote:
> 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?
Are you sure that the data is even being sent when you want it to be?
Until you've verified that it's making it onto the network by looking
at the traffic with a network sniffer, I would hesitate to start
assigning blame and debugging anything.
Mike
_______________________________________________
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