cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: transfer speed control

From: <RBramante_at_on.com>
Date: Tue, 22 Oct 2002 10:16:26 -0400

Go back and see CURLOPT_BUFFERSIZE and set the recv buffer to a smaller
size if you are concerned with the amount of data the remote is sending.
If supported by the underlying stack, this will lower the advertised TCP
window. By advertising a smaller window, you should be automatically rate
limiting the sender. If you delay your reads, then the recv buffer will
fill up sooner and the window will drop, causing the sender to backoff, so
your concerns about excessive buffering, etc. should be unfounded. Rick
Jones can probably give us a better technical explanation based on his
excellent response in the "How to set the size of the send buffer" thread,
but I think this is basically correct in layman's terms.

                                                                                                                                       
                      Vincent Penquerc'h
                      <vincent.penquerch_at_artworks.c To: curl-library_at_lists.sourceforge.net
                      o.uk> cc: vincent.penquerch_at_artworks.ftech.co.uk
                      Sent by: Subject: Re: transfer speed control
                      curl-library-admin_at_lists.sour
                      ceforge.net
                                                                                                                                       
                                                                                                                                       
                      10/21/2002 11:33 AM
                      Please respond to
                      curl-library
                                                                                                                                       
                                                                                                                                       

On Mon, Oct 21, 2002 at 05:04:30PM +0200, Daniel Stenberg wrote:
> On Mon, 21 Oct 2002, Vincent Penquerc'h wrote:
> > There does not seem to be a way to control the data transfer speed.
>
> There is if you're using the easy interface. Just delay your callbacks.

That won't control the transfer speed though, it will just control the
speed at which I retrieve it from libcurl, which probably means that
libcurl will have to allocate more and more memory to buffer the incoming
data until my program reads them. I would like to instruct the distant
server to send at a reduced speed, so there is no excessive buffering of
incoming data, and the associated strain on the client machine.

--
Vincent Penquerc'h
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
-------------------------------------------------------
This sf.net emial is sponsored by: Influence the future 
of Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ad.doubleclick.net/clk;4699841;7576301;v?http://www.sun.com/javavote
Received on 2002-10-22