GNURLOPT_TCP_KEEPINTVL(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’… 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