curl / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Daniel Stenberg <daniel_at_haxx.se>
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:
https://curl.haxx.se/docs/todo.html#Timeout_idle_connections_from_th

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
minutes.

> 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

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html
Received on 2017-01-07