CURLOPT_ACCEPTTIMEOUT_MS.md (1221B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Title: CURLOPT_ACCEPTTIMEOUT_MS 5 Section: 3 6 Source: libcurl 7 See-also: 8 - CURLOPT_CONNECTTIMEOUT_MS (3) 9 - CURLOPT_DEBUGFUNCTION (3) 10 - CURLOPT_STDERR (3) 11 Protocol: 12 - FTP 13 Added-in: 7.24.0 14 --- 15 16 # NAME 17 18 CURLOPT_ACCEPTTIMEOUT_MS - timeout waiting for FTP server to connect back 19 20 # SYNOPSIS 21 22 ~~~c 23 #include <curl/curl.h> 24 25 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ACCEPTTIMEOUT_MS, long ms); 26 ~~~ 27 28 # DESCRIPTION 29 30 Pass a long telling libcurl the maximum number of milliseconds to wait for a 31 server to connect back to libcurl when an active FTP connection is used. 32 33 # DEFAULT 34 35 60000 milliseconds 36 37 # %PROTOCOLS% 38 39 # EXAMPLE 40 41 ~~~c 42 int 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 60 curl_easy_setopt(3) returns a CURLcode indicating success or error. 61 62 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see 63 libcurl-errors(3).