GNURLOPT_TCP_KEEPINTVL(3)
π GNURLOPT_TCP_KEEPINTVL(3) β¨
okay bestie, welcome to the GNURLOPT_TCP_KEEPINTVL(3) page β it lives in the curl_easy_setopt options manual section, and it is literally all about setting the TCP keep-alive interval. no cap.
πΈ NAME πΈ
CURLOPT_TCP_KEEPINTVL β set TCP keep-alive interval. that is the whole vibe.
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TCP_KEEPINTVL, long interval);
π¦ DESCRIPTION π¦
You pass a long, bestie. It sets the interval, in seconds, that the operating system will wait between sending keepalive probes. Not all operating systems support this option β lowkey tragic, but that is the rule. (Added in 7.25.0.)
π DEFAULT π
60
like, sixty seconds is the default, periodt.
π PROTOCOLS π
All β every single protocol, slay.
π EXAMPLE π
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
/* enable TCP keep-alive for this transfer */
curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
/* set keep-alive idle time to 120 seconds */
curl_easy_setopt(curl, CURLOPT_TCP_KEEPIDLE, 120L);
/* interval time between keep-alive probes: 60 seconds */
curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 60L);
curl_easy_perform(curl);
}
β AVAILABILITY β
Always. iconic, honestly.
π₯ RETURN VALUE π₯
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. that is it, that is the tea.
π SEE ALSO π
okay bye bestie, this page is from libcurl 7.37.0, dated 19 Jun 2014 β mwah πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms