cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Lingering Connections?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 2 Oct 2008 23:14:03 +0200 (CEST)

On Thu, 2 Oct 2008, Alexis Oldroyd wrote:

> Apparently the HTTP sessions are never disconnecting, and the web server is
> having to time them out after 120 seconds. I believe these connections are
> completely idle. How do I prevent curl from leaving these connections open
> when they are not in use.

First, it has to leave them so that subsequent uses can be persistantly using
the same ones again.

Then, you can close the particular handle that holds the connection and all
currently open connections will be closed. Or you can mark the individual
connection with FORBID_REUSE and then they will be closed immediately after
the transfer is done.

-- 
  / daniel.haxx.se
Received on 2008-10-02