From f0b7b106ff409f0128dc7bb0f435b37891f297fd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Jun 2019 11:47:17 +0200 Subject: CURLMOPT_SOCKETFUNCTION.3: clarified Moved away the callback explanation from curl_multi_socket_action.3 and expanded it somewhat. Closes #4006 --- docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.3 | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.3') diff --git a/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.3 b/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.3 index e55ff5e0b..dc0ccd836 100644 --- a/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.3 +++ b/docs/libcurl/opts/CURLMOPT_SOCKETFUNCTION.3 @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * -.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +.\" * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al. .\" * .\" * This software is licensed as described in the file COPYING, which .\" * you should have received as part of this distribution. The terms @@ -38,14 +38,24 @@ CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_SOCKETFUNCTION, socket_callb Pass a pointer to your callback function, which should match the prototype shown above. -When the \fIcurl_multi_socket_action(3)\fP function runs, it informs the +When the \fIcurl_multi_socket_action(3)\fP function is called, it informs the application about updates in the socket (file descriptor) status by doing -none, one, or multiple calls to the \fBsocket_callback\fP. The callback gets -status updates with changes since the previous time the callback was called. -If the given callback pointer is NULL, no callback will be called. Set the -callback's \fBuserp\fP argument with \fICURLMOPT_SOCKETDATA(3)\fP. See -\fIcurl_multi_socket_action(3)\fP for more details on how the callback is used -and should work. +none, one, or multiple calls to the \fBsocket_callback\fP. The callback +function gets status updates with changes since the previous time the callback +was called. If the given callback pointer is set to NULL, no callback will be +called. +.SH "CALLBACK ARGUMENTS" +\fIeasy\fP identifies the specific transfer for which this update is related. + +\fIs\fP is the specific socket this function invocation concerns. If the +\fBwhat\fP argument is not CURL_POLL_REMOVE then it holds information about +what activity on this socket the application is supposed to +monitor. Subsequent calls to this callback might update the \fBwhat\fP bits +for a socket that is alredy monitored. + +\fBuserp\fP is set with \fICURLMOPT_SOCKETDATA(3)\fP. + +\fBsocketp\fP is set with \fIcurl_multi_assign(3)\fP or will be NULL. The \fBwhat\fP parameter informs the callback on the status of the given socket. It can hold one of these values: -- cgit v1.2.3