curl / Mailing Lists / curl-library / Single Mail


Re: persistent connections and dns changes

From: Daniel Stenberg <>
Date: Fri, 9 Jun 2017 12:29:13 +0200 (CEST)

On Thu, 8 Jun 2017, Justin Karneges wrote:

> What may be best here is a persistent connection maximum time. Maybe this
> could be a new option, with a large default value like 24 hours? This way
> connections will eventually get unstuck in a reasonable period of time
> (reasonable in server migration terms).

Yes, that feels like a decent middle way to me.

> I'm wondering if I could implement in this behavior in our app without
> needing to modify libcurl, by using a multi instance per domain, and
> destroying a multi instance after it's been around for the maximum time. Is
> it efficient to have lots of multi instances? Right now we have just one
> master multi instance.

There's really no problem with having multiple multi handles from libcurl's

The problem you might get is with driving the transfers. Doing multiple multi
interface transfers in a single thread would either require you to call
curl_multi_perform() on all handles as soon as one has traffic, or you'd need
to somehow remember which handle is responsible for which file descriptors...

Received on 2017-06-09