GNURLOPT_CONNECT_ONLY(3)

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

🌸 NAME 🌸

okay bestie, welcome to the gnurl manual page for GNURLOPT_CONNECT_ONLY(3) β€” the whole vibe is CURLOPT_CONNECT_ONLY: stop when connected to target server. ✨

πŸ’… SYNOPSIS πŸ’…

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CONNECT_ONLY, long
only);

πŸŽ€ DESCRIPTION πŸŽ€

You pass a long. If the parameter equals 1, it tells the library to do all the required proxy authentication and connection setup, but no data transfer, and then return. literally: connect, handle the setup, dip out. πŸ’¨

The option can be used to simply test a connection to a server, but it's more useful when used with the CURLINFO_ACTIVESOCKET(3) option to curl_easy_getinfo(3) β€” because the library can set up the connection, and then the application can obtain the most recently used socket for special data transfers. iykyk. 🫢

Transfers marked connect only will not reuse any existing connections, and connections marked connect only will not be allowed to get reused. no cap, they stay in their own lane. πŸ¦‹

πŸ“ DEFAULT πŸ“

0

🌈 PROTOCOLS 🌈

HTTP, SMTP, POP3 and IMAP

🧚 EXAMPLE 🧚

CURL *curl = curl_easy_init();
if(curl) {
  CURLcode ret;
  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
  ret = curl_easy_perform(curl);
  if(ret == CURLE_OK) {
    /* only connected! */
  }
}

⭐ AVAILABILITY ⭐

Added in 7.15.2 β€” vintage icon behavior, honestly. πŸ‘‘

πŸ’œ RETURN VALUE πŸ’œ

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.

πŸ”₯ SEE ALSO πŸ”₯


byeee bestie 🫢 this page is from libcurl 7.37.0, dated 19 Jun 2014, and you just read the GNURLOPT_CONNECT_ONLY(3) manual. slay. πŸ’…βœ¨

πŸ“¦ where this page comes from