Re: DNS data not refreshed after CURLOPT_DNS_CACHE_TIMEOUT
Date: Sun, 30 Aug 2020 16:47:21 +0200 (CEST)
On Sun, 30 Aug 2020, Narasimha M wrote:
> Is there a way to force the name resolution/DNS checking periodically.
You can for example close your handle and crete a new one, so that the
connection won't survive.
> In my particular case, I would like to keep a single connection and check
> for updates on the server using that connection forever.
If you want to reuse the connection, why would you bother to resolve the name
over and over? It's pointless then!
> Could you please explain when CURLOPT_DNS_CACHE_TIMEOUT is used?
When libcurl wants to resolve a host name it checks if the address is already
present in its DNS cache, where it will be stored and used for up to
CURLOPT_DNS_CACHE_TIMEOUT seconds.
> If the connection lives for more than this time and if the time between
> performs is more than this time, resolution would be done.
Not at all. If there's an existing connection present already, there's no need
to resolve the name.
-- / daniel.haxx.se | Commercial curl support up to 24x7 is available! | Private help, bug fixes, support, ports, new features | https://www.wolfssl.com/contact/ ------------------------------------------------------------------- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2020-08-30