cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: how to do the equivalent of a socket read timeout

From: Joel Firehammer <jfireham_at_tibco.com>
Date: Fri, 28 Sep 2012 17:28:22 +0000

> I have code that can download a file that can be quite large. I would
> rather not set the CURLOPT_TIMEOUT, as I don't know how large it is.
> In java, I can use blocking IO and the combination of the connect and
> read timeouts. As I understand the cURL libraries use non-blocking IO,
> and does not have a read timeout equivalent. Can anyone recommend how
> I would do this, that is, after connect, timeout if I have not received any data for X amount if time?

I decided it was about time I added a new section to the FAQ:

    http://curl.haxx.se/docs/faq.html#I_want_a_different_time_out

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Thanks Daniel and Avi.
Setting CURLOPT_LOW_SPEED_LIMIT to 1024 and CURLOPT_LOW_SPEED_TIME to my timeout did the trick.
-joel
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-09-28