cURL / Mailing Lists / curl-library / Single Mail


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

From: svante karlsson <>
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

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


List admin:
Received on 2014-01-14