cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Detecting request completion with asynchronous interface

From: bp <bp.personal_at_gmail.com>
Date: Mon, 9 Mar 2009 14:30:16 -0400

On Mon, Mar 9, 2009 at 11:31 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> It is probably better with the single multi handle as then you'll gain from
> connection re-use which the multiple multi handles approach won't.
>

I think you can simplify by simply always call curl_multi_info_read()
> immediately after the curl_multi_socket_action() calls, no matter if the
> call was due to fd activity or timeout.
>

I am currently using a separate multi handle for each easy handle in order
to keep things simple. Using one multi handle becomes a little more
complicated because I would need my own map of CURL* -> user data. (I don't
see a way to store such information in the CURLM that would be available
from curl_multi_info_read().)

Anyway, it's now working nicely. It was painless to create a thin OO
wrapper and integrate into our middleware. Thanks for the API advice.
Received on 2009-03-09