1CURLOPT_CONNECTTIMEOUT_MS(3)curl_easy_setopt optionsCURLOPT_CONNECTTIMEOUT_MS(3)
2
3
4

NAME

6       CURLOPT_CONNECTTIMEOUT_MS - timeout for the connect phase
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CONNECTTIMEOUT_MS,
12                                 long timeout);
13

DESCRIPTION

15       Pass  a  long.  It should contain the maximum time in milliseconds that
16       you allow the connection phase to the server to take.  This only limits
17       the  connection  phase,  it has no impact once it has connected. Set to
18       zero to switch to the default built-in connection timeout  -  300  sec‐
19       onds. See also the CURLOPT_TIMEOUT_MS(3) option.
20
21       In  unix-like  systems, this might cause signals to be used unless CUR‐
22       LOPT_NOSIGNAL(3) is set.
23
24       If both CURLOPT_CONNECTTIMEOUT(3) and CURLOPT_CONNECTTIMEOUT_MS(3)  are
25       set, the value set last will be used.
26
27       The  "connection  phase" is considered complete when the requested TCP,
28       TLS or QUIC handshakes are done.
29

DEFAULT

31       300000
32

PROTOCOLS

34       All
35

EXAMPLE

37       CURL *curl = curl_easy_init();
38       if(curl) {
39         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
40
41         /* complete connection within 10000 milliseconds */
42         curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, 10000L);
43
44         curl_easy_perform(curl);
45       }
46

AVAILABILITY

48       Always
49

RETURN VALUE

51       Returns CURLE_OK
52

SEE ALSO

54       CURLOPT_CONNECTTIMEOUT(3),           CURLOPT_TIMEOUT(3),           CUR‐
55       LOPT_LOW_SPEED_LIMIT(3),
56
57
58
59libcurl 8.0.1                  January 02, 2023   CURLOPT_CONNECTTIMEOUT_MS(3)
Impressum