curl-and-python

RE: CURLE_OPERATION_TIMEDOUT while connecting.

From: Utsav Sabharwal <tashywashysachy_at_live.in>
Date: Fri, 4 May 2012 00:43:49 +0530

> In other words when i call setopt(pycurl.TIMEOUT, 5) a time diff will
> be calculated with now or with some stored value?

It means if your pycURL function doesn't execute within 5 seconds, time out error shall be raised.

> The reason i am asking is because it is seems all owrking ok with
> multi.socket_action(pycurl.SOCKET_TIMEOUT, 0) when i do not set
> timeouts ( setopt(pycurl.TIMEOUT, 5) and setopt(pycurl.CONNECTTIMEOUT,
> 1) )

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?
If yes, please note CURLOPT_TIMEOUT is the maximum number of seconds to allow cURL functions to execute. Default timeout is 0 (zero) which means it never times out.

Reference: http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTTIMEOUT

> >> Another option for me would be - to set some high timeouts that i know is> >> not going to be reached (i will remove handle earlier). But the thing that> >> bothers me in this solution is an issue from previous letter: after 130> >> seconds of idle i added fresh new handle to multi and info_read said that it> >> is timed out. Could you please explain me this behavior - is it an error in> >> my code?
I am not sure if their is an error in your code or pycurl. The debug says: <130 seconds later whan keepalive sockets is closed by remote>which means the connection was forcefully closed by the remote server (the server you made request to). May be the server dont wish you to connect in way you wish to.
If still the question seems unresolved can you please elaborate? Why dont you write a working snippet with sample inputs presenting unexpected pycurl observation? I am sure once I am clear with your situation, I would be able to help :)

Are you referring to your code you shared in the previous email? (http://pastebin.com/bEK8Twqe)

d_r_a_g_o_s

Are you following us on twitter? @pycurl

                                               

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2012-05-03