Re: Close sockets asynchronously when using libdispatch (GCD)

2023-01-31 Thread Dan Fandrich via curl-library
On Tue, Jan 31, 2023 at 09:58:13AM +0100, Frederik Seiffert wrote: > Could you please explain what you mean by "compiling with a different > resolver"? I didn’t see any build options like that. Do you maybe mean > building with "CURL_DISABLE_SOCKETPAIR"? I mean using the

Re: Close sockets asynchronously when using libdispatch (GCD)

2023-01-31 Thread Frederik Seiffert via curl-library
Hi Dan, > Am 20.01.2023 um 18:53 schrieb Dan Fandrich via curl-library > : > >> 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: >>

Re: Close sockets asynchronously when using libdispatch (GCD)

2023-01-20 Thread Frederik Seiffert via curl-library
> Am 16.01.2023 um 19:24 schrieb Dan Fandrich via curl-library > : > > 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

Re: Close sockets asynchronously when using libdispatch (GCD)

2023-01-16 Thread Dan Fandrich via curl-library
On Mon, Jan 16, 2023 at 04:30:48PM +0100, Frederik Seiffert via curl-library wrote: > When receiving CURL_POLL_REMOVE, I call dispatch_source_cancel() [2] to stop > the dispatch source. As this is done asynchronously, it is required to wait > for the cancellation handler before closing the

Close sockets asynchronously when using libdispatch (GCD)

2023-01-16 Thread Frederik Seiffert via curl-library
Hi all, I’m working on a networking API using multi handles and multi sockets, and using libdispatch (GCD) to monitor socket changes (via the "dispatch source" API [1]). When receiving CURL_POLL_REMOVE, I call dispatch_source_cancel() [2] to stop the dispatch source. As this is done