summaryrefslogtreecommitdiff
path: root/doc/docstrings
diff options
context:
space:
mode:
authorOleg Pudeyev <code@olegp.name>2021-07-21 19:27:08 -0400
committerOleg Pudeyev <code@olegp.name>2021-07-27 22:31:16 -0400
commit1b5a97b658c38d00fe80780a803af9a8e9d94f6f (patch)
tree7c0b76b0381934c12ab36d32233788aaa2d5f7a1 /doc/docstrings
parent81d42eb119093c1da57941001fc7ff448d5c4bea (diff)
downloadpycurl-1b5a97b658c38d00fe80780a803af9a8e9d94f6f.tar.gz
document multi_socket_action usage and add an example, closes #540
Diffstat (limited to 'doc/docstrings')
-rw-r--r--doc/docstrings/multi_assign.rst2
-rw-r--r--doc/docstrings/multi_socket_action.rst12
-rw-r--r--doc/docstrings/multi_socket_all.rst2
3 files changed, 13 insertions, 3 deletions
diff --git a/doc/docstrings/multi_assign.rst b/doc/docstrings/multi_assign.rst
index dbdeac2..b494d2f 100644
--- a/doc/docstrings/multi_assign.rst
+++ b/doc/docstrings/multi_assign.rst
@@ -1,4 +1,4 @@
-assign(sockfd, object) -> None
+assign(sock_fd, object) -> None
Creates an association in the multi handle between the given socket and
a private object in the application.
diff --git a/doc/docstrings/multi_socket_action.rst b/doc/docstrings/multi_socket_action.rst
index cf54802..d2fb1cc 100644
--- a/doc/docstrings/multi_socket_action.rst
+++ b/doc/docstrings/multi_socket_action.rst
@@ -1,7 +1,17 @@
-socket_action(sockfd, ev_bitmask) -> tuple
+socket_action(sock_fd, ev_bitmask) -> (result, num_running_handles)
Returns result from doing a socket_action() on the curl multi file descriptor
with the given timeout.
Corresponds to `curl_multi_socket_action`_ in libcurl.
+The return value is a two-element tuple. The first element is the return
+value of the underlying ``curl_multi_socket_action`` function, and it is
+always zero (``CURLE_OK``) because any other return value would cause
+``socket_action`` to raise an exception. The second element is the number of
+running easy handles within this multi handle. When the number of running
+handles reaches zero, all transfers have completed. Note that if the number
+of running handles has decreased by one compared to the previous invocation,
+this is not mean the handle corresponding to the ``sock_fd`` provided as
+the argument to this function was the completed handle.
+
.. _curl_multi_socket_action: https://curl.haxx.se/libcurl/c/curl_multi_socket_action.html
diff --git a/doc/docstrings/multi_socket_all.rst b/doc/docstrings/multi_socket_all.rst
index 7b743d0..b9de921 100644
--- a/doc/docstrings/multi_socket_all.rst
+++ b/doc/docstrings/multi_socket_all.rst
@@ -1,4 +1,4 @@
-socket_all() -> Tuple.
+socket_all() -> tuple
Returns result from doing a socket_all() on the curl multi file descriptor
with the given timeout.