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.

Re: Guidance on monitoring connection open/close with CURLM API

From: Daniel Stenberg via curl-library <curl-library_at_lists.haxx.se>
Date: Wed, 29 May 2024 23:53:37 +0200 (CEST)

On Wed, 29 May 2024, Cao Duc Quan via curl-library wrote:

> 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.

Right, because the multi handle has no sockets of its own really. Sockets are
used for transfers and the transfers are held or owned by the easy handles.

So, those are the open/close socket callbacks libcurl provides.

> 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.

Why is this a problem?

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2024-05-29