curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Wait for a response using curl_multi_wait

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 22 Mar 2018 16:20:33 +0100 (CET)

On Wed, 21 Mar 2018, Richard Copley wrote:

> I hate to be negative, and I don't want to start a pointless argument.

Negative is good too. If you can tell us why this is a bad idea, I think
that's valuable information! If it truly is a bad idea we shouldn't do it.

> In the PR, curl_multi_poll isn't polling or selecting. It just moves the
> sleep from user code into the library, where the user has no control over
> it. Did I miss something?

Clearly: The existing curl_multi_wait() function already polls all sockets
libcurl knows for the multi handle plus your set of custom file descriptors.

The new thing here would that the discussed new function would work more
similar to how poll() works and actually sleep for a while if there's nothing
to do on any file descriptor. The "for a while" part being what is usually
tricky for applications to figure out and deal with correctly.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2018-03-22