I'm making several requests using threads and I am not interested in the delay required to get the responses.
The most important thing for me is the reception of the response.
I put these values (all the bigger ones return errors): 
c.setopt (pycurl.CONNECTTIMEOUT ,3600000000000000000)
c.setopt (pycurl.TIMEOUT,3600000000000000000) 
But I got the same error just after receiving some responses.
error: (7, 'Failed to connect to localhost port 4000: Connection timed out')
Please can some one help me . 
Thank you very much.
Observing the error: 'Failed to connect to localhost port 4000: Connection timed out'). Are you sure the domains/url you are trying to connect is not including localhost or a domain that resolves to localhost (i.e. 127.0.0.1)? Also port 4000 is not the typical port you will find a web server listening on.
Connection timed out (pycurl)