cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-users Mailing List Archives

Re: CURLE_COULDNT_CONNECT after 120 requests

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 30 Apr 2010 10:33:05 +0200 (CEST)

On Fri, 30 Apr 2010, sandeep m wrote:

> I am working on a code which requires data to be sent for each URL. I used
> following code to send the data. But after 120-130 requests CURL is throwing
> CURL_SOCKET_BAD in connect::singleipconnect(..). It is failing at
> verifyconnect(). It starts working again after 140 if i add delay for CURL
> errors.

As you're using libcurl, you'd be much better off on the curl-library list
which is dedicated for libcurl users and hackers. Please take follow-ups to
that list instead.

You forgot to mention which libcurl version on what operating system.

My first hunch and gut reaction is that this is somehow related to number of
open file handles/sockets but it seems a bit low with only 120-130 requests
for that to happen...

> curl_easy_setopt(curl, CURLOPT_LOCALPORTFUNCTION, getRandomPort);

This is not an option we have in any official libcurl. It seems silly too,
since the local port already is randomly set by the TCP stack.

Also, these local options you use imply binding the socket on the source end
which possibly contribute to your problem.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-30

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET