cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Trying to understand distinction and use of curl_multi_socket and multi_perform etc

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 19 Jan 2010 19:28:47 +0100 (CET)

On Tue, 19 Jan 2010, vick wrote:

> There's both multi_socket and multi_perform interfaces. I am not clear as to
> which is better or not and which one to use in which circumstances. There's
> no discussion, but there's a simplistic example of curl_multi_perform.

I've tried to describe both functions in their respective man pages.

There's a section in libcurl-multi.3 dedicated to the multi_socket API but it
is really lacking contents...

> In any case some digression/explanation of multi_socket and its scenarios
> would be useful.

It basically depends on if you want to run your app event-based (multi_socket)
or more traditionally select()-based (multi_perform).

Please ask specific questions if there are details that are still unclear.

> Also, some code illustrating the below calls would be great.

The hiperfifo.c example displays one use of the multi_socket API. But sure, I
too would welcome more good examples.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-01-19