1 .\" **************************************************************************
3 .\" * Project ___| | | | _ \| |
4 .\" * / __| | | | |_) | |
5 .\" * | (__| |_| | _ <| |___
6 .\" * \___|\___/|_| \_\_____|
8 .\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at https://curl.haxx.se/docs/copyright.html.
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
21 .\" **************************************************************************
23 .TH CURLMOPT_SOCKETFUNCTION 3 "3 Nov 2016" "libcurl 7.39.0" "curl_multi_setopt options"
25 CURLMOPT_SOCKETFUNCTION \- callback informed about what to wait for
28 #include <curl/curl.h>
30 int socket_callback(CURL *easy, /* easy handle */
31 curl_socket_t s, /* socket */
32 int what, /* describes the socket */
33 void *userp, /* private callback pointer */
34 void *socketp); /* private socket pointer */
36 CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_SOCKETFUNCTION, socket_callback);
38 Pass a pointer to your callback function, which should match the prototype
41 When the \fIcurl_multi_socket_action(3)\fP function runs, it informs the
42 application about updates in the socket (file descriptor) status by doing
43 none, one, or multiple calls to the \fBsocket_callback\fP. The callback gets
44 status updates with changes since the previous time the callback was called.
45 If the given callback pointer is NULL, no callback will be called. Set the
46 callback's \fBuserp\fP argument with \fICURLMOPT_SOCKETDATA(3)\fP. See
47 \fIcurl_multi_socket_action(3)\fP for more details on how the callback is used
50 The \fBwhat\fP parameter informs the callback on the status of the given
51 socket. It can hold one of these values:
53 Wait for incoming data. For the socket to become readable.
55 Wait for outgoing data. For the socket to become writable.
57 Wait for incoming and outgoing data. For the socket to become readable or
60 The specified socket/file descriptor is no longer used by libcurl.
72 .BR CURLMOPT_SOCKETDATA "(3), " curl_multi_socket_action "(3), "
73 .BR CURLMOPT_TIMERFUNCTION "(3) "