CURLOPT_TIMEOUT_MS.3 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. .\" generated by cd2nroff 0.1 from CURLOPT_TIMEOUT_MS.md
  2. .TH CURLOPT_TIMEOUT_MS 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_TIMEOUT_MS \- maximum time the transfer is allowed to complete
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TIMEOUT_MS, long timeout);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a long as parameter containing \fItimeout\fP \- the maximum time in
  12. milliseconds that you allow the libcurl transfer operation to take.
  13. See \fICURLOPT_TIMEOUT(3)\fP for details.
  14. .SH DEFAULT
  15. 0 (zero) which means it never times out during transfer.
  16. .SH PROTOCOLS
  17. This functionality affects all supported protocols
  18. .SH EXAMPLE
  19. .nf
  20. int main(void)
  21. {
  22. CURL *curl = curl_easy_init();
  23. if(curl) {
  24. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  25. /* complete within 20000 milliseconds */
  26. curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, 20000L);
  27. curl_easy_perform(curl);
  28. }
  29. }
  30. .fi
  31. .SH AVAILABILITY
  32. Added in curl 7.16.2
  33. .SH RETURN VALUE
  34. Returns CURLE_OK
  35. .SH SEE ALSO
  36. .BR CURLOPT_CONNECTTIMEOUT (3),
  37. .BR CURLOPT_LOW_SPEED_LIMIT (3),
  38. .BR CURLOPT_TCP_KEEPALIVE (3),
  39. .BR CURLOPT_TIMEOUT (3)