CURLINFO_APPCONNECT_TIME_T.3 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. .\" generated by cd2nroff 0.1 from CURLINFO_APPCONNECT_TIME_T.md
  2. .TH CURLINFO_APPCONNECT_TIME_T 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLINFO_APPCONNECT_TIME_T \- time until the SSL/SSH handshake completed
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_APPCONNECT_TIME_T,
  9. curl_off_t *timep);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a pointer to a curl_off_t to receive the time, in microseconds, it took
  13. from the start until the SSL/SSH connect/handshake to the remote host was
  14. completed. This time is most often close to the \fICURLINFO_PRETRANSFER_TIME_T(3)\fP
  15. time, except for cases such as HTTP multiplexing where the pretransfer time
  16. can be delayed 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. curl_off_t 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_T, &connect);
  33. if(CURLE_OK == res) {
  34. printf("Time: %" CURL_FORMAT_CURL_OFF_T ".%06ld", connect / 1000000,
  35. (long)(connect % 1000000));
  36. }
  37. }
  38. /* always cleanup */
  39. curl_easy_cleanup(curl);
  40. }
  41. }
  42. .fi
  43. .SH AVAILABILITY
  44. Added in curl 7.61.0
  45. .SH RETURN VALUE
  46. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  47. .SH SEE ALSO
  48. .BR CURLINFO_APPCONNECT_TIME (3),
  49. .BR curl_easy_getinfo (3),
  50. .BR curl_easy_setopt (3)