GNURLOPT_ACCEPTTIMEOUT_MS(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’… GNURLOPT_ACCEPTTIMEOUT_MS(3) πŸ’…

okay so bestie, welcome to the GNURLOPT_ACCEPTTIMEOUT_MS(3) page β€” it lives in the curl_easy_setopt options manual, and it's here to explain one very specific FTP connect-back timeout. no cap, it's niche but iconic. πŸ¦‹

✨ NAME ✨

  • CURLOPT_ACCEPTTIMEOUT_MS β€” timeout waiting for FTP server to connect back. literally what it says on the tin, bestie. πŸ’…

🌸 SYNOPSIS 🌸

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ACCEPTTIMEOUT_MS, long ms);

πŸ’– DESCRIPTION πŸ’–

Pass a long telling libcurl the maximum number of milliseconds to wait for a server to connect back to libcurl when an active FTP connection is used. that's the whole vibe: you're handing libcurl a patience budget for the FTP server's little connect-back moment. ⏳✨

πŸŽ€ DEFAULT πŸŽ€

60000 milliseconds

six-zero-zero-zero-zero, bestie β€” the default patience is a whole minute. 🫢

πŸ¦‹ PROTOCOLS πŸ¦‹

FTP

FTP only, periodt. no sneaky other protocols here. πŸ’€

🌈 EXAMPLE 🌈

look at this lil' snippet, it's giving "set the timeout and go":

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/path/file");

  /* wait no more than 5 seconds for FTP server responses */
  curl_easy_setopt(curl, CURLOPT_ACCEPTTIMEOUT_MS, 5000L);

  curl_easy_perform(curl);
}

πŸ‘‘ AVAILABILITY πŸ‘‘

Added in 7.24.0 β€” this baddie landed back in the day. πŸŽ€

πŸ’œ RETURN VALUE πŸ’œ

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. slay when it works, and you know exactly which error you got when it doesn't. πŸ’…

🫢 SEE ALSO 🫢


bye bestie 🫢 β€” this page is from libcurl 7.37.0, dated 19 Jun 2014. slay and happy FTPing πŸ’…βœ¨

πŸ“¦ where this page comes from