| 1 |
CurlMulti(close_handles=False) -> New CurlMulti object |
| 2 |
|
| 3 |
Creates a new :ref:`curlmultiobject` which corresponds to |
| 4 |
a ``CURLM`` handle in libcurl. |
| 5 |
|
| 6 |
The ``CurlMulti`` object can be used as a context manager. Exiting the |
| 7 |
context calls ``close()``. |
| 8 |
|
| 9 |
Example:: |
| 10 |
|
| 11 |
with pycurl.CurlMulti(close_handles=True) as m: |
| 12 |
m.add_handle(curl) |
| 13 |
# perform multi operations |
| 14 |
# easy handles have been removed and closed |
| 15 |
|
| 16 |
:param bool close_handles: |
| 17 |
If ``False`` (default), easy handles added to the multi handle |
| 18 |
are removed from the multi handle when ``close()`` is called |
| 19 |
or when exiting the context manager, but remain open and must |
| 20 |
be managed by the caller. |
| 21 |
|
| 22 |
If ``True``, easy handles are removed from the multi handle when |
| 23 |
``close()`` is called or when exiting the context manager, and |
| 24 |
are then automatically closed. |
| 25 |
|
| 26 |
In all cases, easy handles are not closed when they are removed |
| 27 |
individually from the multi handle. |