| 1 |
socket_action(sock_fd, ev_bitmask) -> (result, num_running_handles) |
| 2 |
|
| 3 |
Returns result from doing a socket_action() on the curl multi file descriptor |
| 4 |
with the given timeout. |
| 5 |
Corresponds to `curl_multi_socket_action`_ in libcurl. |
| 6 |
|
| 7 |
PycURL exposes the relevant constants as ``pycurl.CSELECT_IN``, |
| 8 |
``CSELECT_OUT``, ``CSELECT_ERR`` (for *ev_bitmask*) and |
| 9 |
``pycurl.SOCKET_TIMEOUT`` (for *sock_fd*); refer to the |
| 10 |
`curl_multi_socket_action`_ docs for their meaning. |
| 11 |
|
| 12 |
The return value is a two-element tuple. The first element is the return |
| 13 |
value of the underlying ``curl_multi_socket_action`` function, and it is |
| 14 |
always zero (``CURLE_OK``) because any other return value would cause |
| 15 |
``socket_action`` to raise an exception. The second element is the number of |
| 16 |
running easy handles within this multi handle. When the number of running |
| 17 |
handles reaches zero, all transfers have completed. Note that if the number |
| 18 |
of running handles has decreased by one compared to the previous invocation, |
| 19 |
this is not mean the handle corresponding to the ``sock_fd`` provided as |
| 20 |
the argument to this function was the completed handle. |
| 21 |
|
| 22 |
.. _curl_multi_socket_action: https://curl.haxx.se/libcurl/c/curl_multi_socket_action.html |