1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_ACCEPTTIMEOUT_MS
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_CONNECTTIMEOUT_MS (3)
9  - CURLOPT_DEBUGFUNCTION (3)
10  - CURLOPT_STDERR (3)
11Protocol:
12  - FTP
13Added-in: 7.24.0
14---
15
16# NAME
17
18CURLOPT_ACCEPTTIMEOUT_MS - timeout waiting for FTP server to connect back
19
20# SYNOPSIS
21
22~~~c
23#include <curl/curl.h>
24
25CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ACCEPTTIMEOUT_MS, long ms);
26~~~
27
28# DESCRIPTION
29
30Pass a long telling libcurl the maximum number of milliseconds to wait for a
31server to connect back to libcurl when an active FTP connection is used.
32
33# DEFAULT
34
3560000 milliseconds
36
37# %PROTOCOLS%
38
39# EXAMPLE
40
41~~~c
42int main(void)
43{
44  CURL *curl = curl_easy_init();
45  if(curl) {
46    curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/path/file");
47
48    /* wait no more than 5 seconds for FTP server responses */
49    curl_easy_setopt(curl, CURLOPT_ACCEPTTIMEOUT_MS, 5000L);
50
51    curl_easy_perform(curl);
52  }
53}
54~~~
55
56# %AVAILABILITY%
57
58# RETURN VALUE
59
60Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
61