curl-and-python
Re: CURLE_OPERATION_TIMEDOUT while connecting.
Date: Fri, 4 May 2012 09:13:55 +0200 (CEST)
On Fri, 4 May 2012, Evgeny Turnaev wrote:
>> Are you trying to say setting pycurl.TIMEOUT as 0 your code run smoothly
>> but it gives time out error when you set it to 5?
>
> No when i dont set timeout at all.
Setting TIMEOUT to 0 is the same as not setting a timeout.
> Obviously a newly added curl with timeouts set to 1 and 5 seconds cant
> expire just after adding curl.
>
> Daniel, no i dont think this is dns resolving error because debug show newly
> added curl timed outed in a 1 ms (in fact earlier as python logging is slow
> as hell).
There's an internal timeout set to 1ms when you add a new handle, yes. That's
because libcurl wants to to call it again immediately after you've added a
handle so that it can "drive it" as far as possible and it can't (or rather it
won't) do that already in the add handle function function.
But really, let me emphasize what I started out this thread by saying:
You really want to use the libcurl timeout callback (CURLMOPT_TIMERFUNCTION)
when you use the multi_socket API. If you don't, you really need to know what
you're doing and how libcurl works to be able to reach the same functionality
anyway and I don't mean to be rude but you really don't give the impression of
having that control or knowledge.
-- / daniel.haxx.se
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2012-05-04