cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Stoping all sessions - multi interface

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 19 Sep 2011 14:18:08 +0200 (CEST)

On Mon, 19 Sep 2011, Yoav Einav wrote:

> Say I have multiple simultaneous transfers using the multi interface, and
> I'd like to stop all active transfers and remove them.
>
> How can I do it exactly in a safe way? 1 or 2? Or maybe both?
>
> 1. curl_multi_remove_handle (for each easy handle)
>
> 2. curl_multi_cleanup (for multi handle)

If you want to stop all transfers then just stop call curl_multi_perform() and
nothing more will happen.

Calling curl_multi_remove_handle() for all added handles will of course remove
them all from the multi handle and then even calling curl_multi_perform()
again won't make anything happen.

Calling curl_multi_cleanup() to kill the multi handle will of course cleanup
the handle and associated resources.

If you cleanup everything, you must also curl_easy_cleanup() each easy handle
after they've been removed from the multi handle.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-09-19