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: What is curl_multi_perform for?

From: Dan Fandrich via curl-library <curl-library_at_lists.haxx.se>
Date: Fri, 2 Aug 2024 11:39:58 -0700

On Fri, Aug 02, 2024 at 06:10:38PM +0000, Jeff Mears via curl-library wrote:
> In a program using curl_multi_socket_action in a select/poll loop, what is
> curl_multi_perform supposed to be used for? I¢ve been simply not calling it,
> and things seem to work, but doing this seems incorrect somehow.

The multi interface provides two different ways of running the transfer loop:
curl_multi_perform and curl_multi_socket_action. The application only needs to
call one of them for libcurl to do its thing. Which one is the best to call
depends on the architecture of the application. curl_multi_perform is easier
to use and is typically used with select or poll while curl_multi_socket_action
is often used in an event-based application (based around something like
libevent) and allows higher performance with many open handles. Many other
curl_multi_* functions only make sense to call in conjunction with only one of
these two.

The page https://curl.se/libcurl/c/libcurl-multi.html#MULTISOCKET goes into
some more detail on the two approaches.

Dan
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2024-08-02