cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: question about curl_multi_socket

From: Sun Yi-Ming <yimings_at_cgogo.com>
Date: Sat, 7 Jan 2006 08:15:10 +0800

On Fri, Jan 06, 2006 at 08:21:47PM +0100, Daniel Stenberg wrote:
>Hm. I *think* we can solve the problem like this:
>
>1 - We set the socket callback with a new curl_multi_setopt() function (in
> similar style how callbacks are set for easy handles). We would then of
> course remove the callback arguments from the *socket() and
> *socket_all()
> functions.
>
>2 - When an app removes an easy handle from a multi handle and thus the
> sockets no longer are used by libcurl it calls the callback accordingly
> to
> mark them as removed.
>
>What do you say about that approach?
>

yes, perhaps that's an elegant way. then, we use curl_multi_setopt to
set callbacks to inform the outter application to update descriptors,
and use curl_multi_socket and curl_multi_socket_all to inform libcurl to
perform! that's good.

-- 
Sun Yi Ming
Programs must be written for people to read, 
and only incidentally for machines to execute.
                                    ---- SCIP
Received on 2006-01-07