GNURLOPT_CONNECT_ONLY(3)
πΈ 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
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms