1CURLOPT_TCP_KEEPINTVL(3) curl_easy_setopt options CURLOPT_TCP_KEEPINTVL(3)
2
3
4
6 CURLOPT_TCP_KEEPINTVL - set TCP keep-alive interval
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TCP_KEEPINTVL, long in‐
12 terval);
13
15 Pass a long. Sets the interval, in seconds, that the operating system
16 will wait between sending keepalive probes. Not all operating systems
17 support this option. (Added in 7.25.0)
18
20 60
21
23 All
24
26 CURL *curl = curl_easy_init();
27 if(curl) {
28 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
29
30 /* enable TCP keep-alive for this transfer */
31 curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
32
33 /* set keep-alive idle time to 120 seconds */
34 curl_easy_setopt(curl, CURLOPT_TCP_KEEPIDLE, 120L);
35
36 /* interval time between keep-alive probes: 60 seconds */
37 curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 60L);
38
39 curl_easy_perform(curl);
40 }
41
43 Always
44
46 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
47 if not.
48
50 CURLOPT_TCP_KEEPALIVE(3), CURLOPT_TCP_KEEPIDLE(3),
51
52
53
54libcurl 7.76.1 November 04, 2020 CURLOPT_TCP_KEEPINTVL(3)