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