curl-library
Re: Detecting request completion with asynchronous interface
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 8 Mar 2009 23:58:41 +0100 (CET)
Date: Sun, 8 Mar 2009 23:58:41 +0100 (CET)
On Thu, 5 Mar 2009, bp wrote:
> I am using the multi interface to implement asynchronous requests via
> CURLMOPT_SOCKETFUNCTION/curl_multi_socket_action() etc
>
> On the easy handle, I have a write callback to receive notifications as data
> arrives, but I don't see any obvious way to know when the request has
> completed. (My code needs a kick to do stuff with it and also curl cleanup.)
The primary hint: the 'running_handles' counter decreases.
Then you use curl_multi_info_read() to figure out exactly which of the
transfers that ended (if you use multiple) and what the return code from that
particular transfer was.
Good enough?
-- / daniel.haxx.seReceived on 2009-03-09