Home All Groups Group Topic Archive Search About

WebRequest Set Content-Length for reply?

Author
15 Mar 2006 12:56 AM
Mark Olbert
I'm writing an app which downloads large files over http. Is there a way to set how large the chunks of data should be that come
back from the server when I create/submit the WebRequest? Or is that totally up to the server?

I've noticed that (in my case, at least), the data that I pull off of the response stream comes in 32KB chunks. But I'm not
specifying that anywhere that I know of.

- Mark

Author
15 Mar 2006 12:00 PM
AMercer
> I'm writing an app which downloads large files over http. Is there a way to
set how large the chunks of data should be that come
> back from the server when I create/submit the WebRequest? Or is that totally up to the server?

I think that is negotiated between your pc and other elements of the
network, and I don't think you can influence it.  I doubt that the server has
much to say about it either.

> I've noticed that (in my case, at least), the data that I pull off of the response stream comes in 32KB chunks. But I'm not
> specifying that anywhere that I know of.

Somewhere in the process, you instantiate an IO.StreamReader, right?  One of
its constructors takes a buffersize parameter, and readblock takes a count
parameter.  The documentation offers some performance guidance.
Author
15 Mar 2006 8:39 PM
Joerg Jooss
Thus wrote Mark,

> I'm writing an app which downloads large files over http. Is there a
> way to set how large the chunks of data should be that come
>
> back from the server when I create/submit the WebRequest? Or is that
> totally up to the server?

That's pretty much up to the server. Only the HTTP version of the client
may have an effect here, but not at a granular level like specifying a certain
chunk size. 

Cheers,
--
Joerg Jooss
news-re***@joergjooss.de

AddThis Social Bookmark Button