curl-library
Re: Connection Options
Date: Sat, 3 Apr 2004 14:59:44 +0200 (CEST)
On Fri, 2 Apr 2004, Monica Lau wrote:
> However, for the "recv()" socket system call, I believe this system call
> will block and wait for the response from the server
No, libcurl uses non-blocking sockets so it won't block on this.
> so there is no OS default timeout for this, right?
This is still true though, there's no timeout for a recv().
> If this is the case, how does libcurl implement the "GET" request to the web
> server? If it uses the underlying "recv()" system call, then we must set
> the CURLOPT_TIMEOUT value to prevent blocking behavior?
Nope. But if you use curl_easy_perform() in the same thread, it might of
course take a good while before it returns.
> So, I'm just wondering if libcurl implements non-blocking or blocking system
> calls and if I need to set the CURLOPT_TIMEOUT value.
If you want to use as little blocking calls as possible, then I recommend
using the multi interface. It was designed for that.
-- Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se Dedicated custom curl help for hire: http://haxx.se/curl.htmlReceived on 2004-04-03