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)
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Dan Fandrich via curl-library <curl-library_at_lists.haxx.se>
Date: Fri, 20 Jan 2023 09:53:20 -0800
On Fri, Jan 20, 2023 at 11:52:41AM +0100, Frederik Seiffert wrote:
> 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
That's a special case, but an interesting one. I'm not sure if that use
overlooked the socket callback functions, or if it was added with the idea
being that since the socket isn't used for data transfer, it doesn't need to
use the callbacks. In any case, you can easily stop use of that socket by
compiling with a different resolver.
> 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.
The multi handle consists of a bunch of easy handles and the multi handles
doesn't have sockets of its own. It will sometimes share sockets between the
easy handles under its umbrella, though (at least, I'm not aware of any
exceptions to this).
Dan
Date: Fri, 20 Jan 2023 09:53:20 -0800
On Fri, Jan 20, 2023 at 11:52:41AM +0100, Frederik Seiffert wrote:
> 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
That's a special case, but an interesting one. I'm not sure if that use
overlooked the socket callback functions, or if it was added with the idea
being that since the socket isn't used for data transfer, it doesn't need to
use the callbacks. In any case, you can easily stop use of that socket by
compiling with a different resolver.
> 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.
The multi handle consists of a bunch of easy handles and the multi handles
doesn't have sockets of its own. It will sometimes share sockets between the
easy handles under its umbrella, though (at least, I'm not aware of any
exceptions to this).
Dan
-- Unsubscribe: https://lists.haxx.se/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.htmlReceived on 2023-01-20