curl / Mailing Lists / curl-library / Single Mail


Re: How to shutdown idle connections automatically after a given time

From: Daniel Stenberg <>
Date: Sat, 7 Jan 2017 01:45:27 +0100 (CET)

On Thu, 5 Jan 2017, Igor Gatis wrote:

> How long does CURL keep connections open for?

There's no time limit at all currently. That's however something we'd like to
add, as mentioned in the TODO:

In practice, servers rarely keep their end of connections alive for much more
than a few minutes with no traffic and also for most use cases the likeliness
that a connection will get reused is drastically reduced already after a few

> Is there a way to tell CURL to close connections once they get idle for a
> given period of time?

Nope. Idle connections remain in the connection cache until

  1 - the connection is reused
  2 - the connection is killed because the cache needs the space
  3 - the cache is shut down and killed

List admin:
Received on 2017-01-07