cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: correct usage of curl_multi_setopt(_multi, CURLMOPT_SOCKETFUNCTION, _sock_cb); / curl_multi_remove_handle / curl_easy_cleanup

From: svante karlsson <saka_at_csi.se>
Date: Tue, 14 Jan 2014 10:20:21 +0100

>I mean it should be something like that:
>Your application will get an event on a "socket" (in multi you are the one
that listen on the sockets)
> You are calling to curl_multi_socket_action on this socket (to
notify multi there is a progress)
> curl_multi understand the socket should be closed
> curl_mutli call your application to remove the socket
> ----> your application remove the socket (from your event
queue)

Yep, that was it.
Since I'm using asio I moved the cleanup calls (A + B) to a separate
function and called this using
_io_service.post(boost::bind(&http_client_async_handler::_poll_remove,
this, context));
which means that it will be called after the current callback has ended.

Thanks

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