CURLINFO_APPCONNECT_TIME.3 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. .\" generated by cd2nroff 0.1 from CURLINFO_APPCONNECT_TIME.md
  2. .TH CURLINFO_APPCONNECT_TIME 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLINFO_APPCONNECT_TIME \- get the time until the SSL/SSH handshake is completed
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_APPCONNECT_TIME,
  9. double *timep);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a pointer to a double to receive the time, in seconds, it took from the
  13. start until the SSL/SSH connect/handshake to the remote host was completed.
  14. This time is most often close to the \fICURLINFO_PRETRANSFER_TIME(3)\fP time, except
  15. for cases such as HTTP multiplexing where the pretransfer time can be delayed
  16. due to waits in line for the stream and more.
  17. When a redirect is followed, the time from each request is added together.
  18. See also the TIMES overview in the \fIcurl_easy_getinfo(3)\fP man page.
  19. .SH PROTOCOLS
  20. This functionality affects all supported protocols
  21. .SH EXAMPLE
  22. .nf
  23. int main(void)
  24. {
  25. CURL *curl = curl_easy_init();
  26. if(curl) {
  27. CURLcode res;
  28. double connect;
  29. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  30. res = curl_easy_perform(curl);
  31. if(CURLE_OK == res) {
  32. res = curl_easy_getinfo(curl, CURLINFO_APPCONNECT_TIME, &connect);
  33. if(CURLE_OK == res) {
  34. printf("Time: %.1f", connect);
  35. }
  36. }
  37. /* always cleanup */
  38. curl_easy_cleanup(curl);
  39. }
  40. }
  41. .fi
  42. .SH AVAILABILITY
  43. Added in curl 7.19.0
  44. .SH RETURN VALUE
  45. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  46. .SH SEE ALSO
  47. .BR CURLINFO_APPCONNECT_TIME_T (3),
  48. .BR curl_easy_getinfo (3),
  49. .BR curl_easy_setopt (3)