tcpkeepalive: add CURLOPT_TCP_KEEPCNT and --keepalive-cnt

Closes #13885
This commit is contained in:
Andy Pan 2024-06-05 11:30:16 +08:00 committed by Daniel Stenberg
parent 02ff5d53a8
commit b77d627d24
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
25 changed files with 210 additions and 20 deletions

View file

@ -44,6 +44,9 @@ int main(void)
/* interval time between keep-alive probes: 60 seconds */
curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 60L);
/* maximum number of keep-alive probes: 3 */
curl_easy_setopt(curl, CURLOPT_TCP_KEEPCNT, 3L);
curl_easy_setopt(curl, CURLOPT_URL, "https://curl.se/");
res = curl_easy_perform(curl);