12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #include <stdio.h>
- #include <curl/curl.h>
- int main(void)
- {
- CURL *curl;
- CURLcode res = CURLE_OK;
- curl = curl_easy_init();
- if(curl) {
-
- curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
-
- curl_easy_setopt(curl, CURLOPT_TCP_KEEPIDLE, 120L);
-
- curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 60L);
-
- curl_easy_setopt(curl, CURLOPT_TCP_KEEPCNT, 3L);
- curl_easy_setopt(curl, CURLOPT_URL, "https://curl.se/");
- res = curl_easy_perform(curl);
- curl_easy_cleanup(curl);
- }
- return (int)res;
- }
|