cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Timeout in milliseconds

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 16 Apr 2006 12:36:57 +0200 (CEST)

On Thu, 13 Apr 2006, Dan Petitt wrote:

> I would like to set a connecttimeout and timeout in milli-secs, but for some
> reason even though the code deals with these values in milli-secs the code
> multiplies the setting value passed by 1000 and thus it only accepts timeout
> values in seconds.

It isn't so strange. It is just the way we did the timeouts once upon the time
and we've never had reason to change them.

> This seems a bit strange, what could have been flexible has been configured
> to not be.

I wouldn't call it that, but that's me.

> So I am thinking there must be a good reason other than usability.

We don't change things people haven't had a reason to change.

Also, some things (like the timeout of name resolves using alarm) in libcurl
uses full-second resolution for the timeout so adding millisecond options
aren't necessary to always cause millisecond control of the timeouts.

> Is there anyway that we could have new options added "connecttimeoutmilli"
> and "timeoutmilli" that does the appropriate thing ... it should be quite
> easy to add, but I don't want to change our codebase if at all possible as
> it makes it more of a hassle merging new versions of libcurl?

I could agree with adding such options to libcurl.

In fact, we could most likely benefit from making some of the timeout checks
more generic functions to be used from all over instead of having timeout
checks spread out in numerous functions the way we do today.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-04-16