cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Got "Couldn't connect to server" after running some time

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 27 Mar 2007 20:38:35 -0700

On Tue, Mar 27, 2007 at 12:14:15PM -0700, Chung Pak Lai wrote:
> I am new to this Forum. I have been experienced a strange behavior with libcurl
> after running a minute. My program is pretty simple, it basically fetch a http
> document repeatly. However, after running a minute or two, it starts
> complaining about "Couldn't connect to server". And this problem ONLY happens
> on WINDOWS, I have ran the same program on linux and it runs fine. Here is the
> piece of code that I am running. Am I doing something wrong in my program?

You're loading that same URL in a very tight loop. I suspect you're running
out of sockets. What does netstat tell you when you get into this state?
If you avoid cleaning up your easy handle each time around, libcurl will
attempt to leave the connection open, which would solve this problem if
it is running out of sockets.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2007-03-28