curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder Daniel himself.

Guidance on monitoring connection open/close with CURLM API

From: Cao Duc Quan via curl-library <curl-library_at_lists.haxx.se>
Date: Wed, 29 May 2024 12:54:08 -0700

Hi all,

I am seeking guidance on monitoring socket connection open/close. My
application is based on CURLM APIs where we construct HTTP requests (we use
HTTP2) and submit them to CURLM by calling curl_multi_add_handle
<https://curl.se/libcurl/c/curl_multi_add_handle.html>().
We plan to add metrics to monitor connectivities such as socket open/close.
It seems to me that only CURL APIs support open/close socket callbacks
CURLOPT_CLOSESOCKETFUNCTION
<https://curl.se/libcurl/c/CURLOPT_CLOSESOCKETFUNCTION.html> but we do not
have similar APIs for CURLM.

The problem is that the lifetime of the socket in CURLM maybe longer
compared with the easy handle, which means the CURL object could be
finished and removed before the socket is closed.

Any suggestions to solve this?

-- 
--------------------------------
Watson Cao


-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2024-05-29