Base code merged to SPIN 2.4
[platform/upstream/curl.git] / docs / libcurl / opts / CURLMOPT_SOCKETFUNCTION.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
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 http://curl.haxx.se/docs/copyright.html.
13 .\" *
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.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .\"
23 .TH CURLMOPT_SOCKETFUNCTION 3 "3 Nov 2014" "libcurl 7.39.0" "curl_multi_setopt options"
24 .SH NAME
25 CURLMOPT_SOCKETFUNCTION \- callback informed about what to wait for
26 .SH SYNOPSIS
27 .nf
28 #include <curl/curl.h>
29
30 int socket_callback(CURL *easy,      /* easy handle */
31                     curl_socket_t s, /* socket */
32                     int what,        /* see above */
33                     void *userp,     /* private callback pointer */
34                     void *socketp);  /* private socket pointer */
35
36 CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_SOCKETFUNCTION, socket_callback);
37 .SH DESCRIPTION
38 Pass a pointer to your callback function, which should match the prototype
39 shown above.
40
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
48 and should work.
49 .SH DEFAULT
50 NULL (no callback)
51 .SH PROTOCOLS
52 All
53 .SH EXAMPLE
54 TODO
55 .SH AVAILABILITY
56 Added in 7.15.4
57 .SH RETURN VALUE
58 Returns CURLM_OK.
59 .SH "SEE ALSO"
60 .BR CURLMOPT_SOCKETDATA "(3), " curl_multi_socket_action "(3), "
61 .BR CURLMOPT_TIMERFUNCTION "(3) "
62