CURLOPT_TIMEOUT_MS(3)

πŸ’– NAME πŸ’–

okay so bestie, welcome to CURLOPT_TIMEOUT_MS(3) from the Library Functions Manual β€” this page is literally about the maximum time the transfer is allowed to complete. It's your little libcurl deadline knob. πŸŽ€

✨ SYNOPSIS ✨

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TIMEOUT_MS, long timeout);

πŸ¦‹ DESCRIPTION πŸ¦‹

Pass a long as the parameter containing timeout β€” the maximum time in milliseconds that you allow the libcurl transfer operation to take. That's the whole vibe. ⏳

See CURLOPT_TIMEOUT(3) for details. πŸ‘€

πŸ“ DEFAULT πŸ“

0 (zero), which means it never times out during transfer. No deadline, no cap, just unlimited-transfer energy. πŸ˜­πŸ’…

🌈 PROTOCOLS 🌈

This functionality affects all supported protocols. all of them. periodt. πŸ’…βœ¨

πŸ”₯ EXAMPLE πŸ”₯

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");

    /* complete within 20000 milliseconds */
    curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, 20000L);

    curl_easy_perform(curl);
  }
}

⭐ AVAILABILITY ⭐

Added in curl 7.16.2. iconic since way back. πŸ‘‘

πŸ’œ RETURN VALUE πŸ’œ

curl_easy_setopt(3) returns a CURLcode indicating success or error.

CURLE_OK (0) means everything was OK, non-zero means an error occurred, see libcurl-errors(3). 🫢

🫢 SEE ALSO 🫢


and that's the page, bestie πŸ’– this one comes from libcurl, dated 2026-10-12, and its manual entry is CURLOPT_TIMEOUT_MS(3) β€” mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from