curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. 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 himself.

Re: Close sockets asynchronously when using libdispatch (GCD)

From: Frederik Seiffert via curl-library <curl-library_at_lists.haxx.se>
Date: Fri, 20 Jan 2023 11:52:41 +0100

> Am 16.01.2023 um 19:24 schrieb Dan Fandrich via curl-library <curl-library_at_lists.haxx.se>:
>
> IMHO, that sounds like a good approach. curl assumes POSIX semantics on sockets
> which allow them to be closed at any time. If your environment doesn't allow
> that, then hooking in to CURLOPT_CLOSESOCKETFUNCTION sounds like a good way
> to maintain those semantics.


Unfortunately it seems that in some cases when using multi handles this "close socket function" is not being used, so I don’t think this approach would fully work atm:
https://github.com/curl/curl/blob/f8da4f2f2d0451dc0a126ae3e5077b4527ccdc86/lib/asyn-thread.c#L409-L410

Would the multi handle API also need open/close functions to be added in order for this to be supported? Sorry I’m not familiar with how sockets are being used between easy and multi handles.

Thanks,
Frederik



-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-01-20