1curl_multi_setopt(3)            libcurl Manual            curl_multi_setopt(3)
2
3
4

NAME

6       curl_multi_setopt - set options for a curl multi handle
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLMcode  curl_multi_setopt(CURLM  * multi_handle, CURLMoption option,
12       param);
13

DESCRIPTION

15       curl_multi_setopt() is used to tell  a  libcurl  multi  handle  how  to
16       behave.  By  using the appropriate options to curl_multi_setopt(3), you
17       can change libcurl's behaviour  when  using  that  multi  handle.   All
18       options  are  set with the option followed by the parameter param. That
19       parameter can be a long, a function pointer, an  object  pointer  or  a
20       curl_off_t  type,  depending  on what the specific option expects. Read
21       this manual carefully as bad input values may cause libcurl  to  behave
22       badly!  You can only set one option in each function call.
23
24

OPTIONS

26       CURLMOPT_SOCKETFUNCTION
27              Pass  a  pointer to a function matching the curl_socket_callback
28              prototype. The curl_multi_socket_action(3) function informs  the
29              application about updates in the socket (file descriptor) status
30              by doing none, one, or multiple calls to  the  curl_socket_call‐
31              back  given  in  the param argument. They update the status with
32              changes since the previous time a curl_multi_socket(3)  function
33              was  called.  If the given callback pointer is NULL, no callback
34              will be called. Set the callback's  userp  argument  with  CURL‐
35              MOPT_SOCKETDATA.   See  curl_multi_socket(3)  for  more callback
36              details.
37
38       CURLMOPT_SOCKETDATA
39              Pass  a  pointer  to   whatever   you   want   passed   to   the
40              curl_socket_callback's  forth  argument, the userp pointer. This
41              is not used by libcurl but only passed-thru as-is. Set the call‐
42              back pointer with CURLMOPT_SOCKETFUNCTION.
43
44       CURLMOPT_PIPELINING
45              Pass  a  long set to 1 to enable or 0 to disable. Enabling pipe‐
46              lining on a multi handle will make it attempt  to  perform  HTTP
47              Pipelining  as  far as possible for transfers using this handle.
48              This means that if you add a second  request  that  can  use  an
49              already  existing connection, the second request will be "piped"
50              on the same connection rather than being executed  in  parallel.
51              (Added in 7.16.0)
52
53       CURLMOPT_TIMERFUNCTION
54              Pass a pointer to a function matching the curl_multi_timer_call‐
55              back prototype.  This function will  then  be  called  when  the
56              timeout  value changes. The timeout value is at what latest time
57              the application should call one of the "performing" functions of
58              the    multi    interface    (curl_multi_socket_action(3)    and
59              curl_multi_perform(3)) - to allow libcurl to keep  timeouts  and
60              retries  etc  to work. A timeout value of -1 means that there is
61              no timeout at all, and 0  means  that  the  timeout  is  already
62              reached.  Libcurl  attempts  to limit calling this only when the
63              fixed future timeout  time  actually  changes.  See  also  CURL‐
64              MOPT_TIMERDATA.  This  callback  can  be  used instead of, or in
65              addition to, curl_multi_timeout(3). (Added in 7.16.0)
66
67       CURLMOPT_TIMERDATA
68              Pass  a  pointer  to   whatever   you   want   passed   to   the
69              curl_multi_timer_callback's  third  argument, the userp pointer.
70              This is not used by libcurl but only passed-thru as-is. Set  the
71              callback pointer with CURLMOPT_TIMERFUNCTION. (Added in 7.16.0)
72
73       CURLMOPT_MAXCONNECTS
74              Pass  a  long. The set number will be used as the maximum amount
75              of simultaneously  open  connections  that  libcurl  may  cache.
76              Default  is 10, and libcurl will enlarge the size for each added
77              easy handle to make it fit 4 times the number of added easy han‐
78              dles.
79
80              By  setting  this  option,  you  can prevent the cache size from
81              growing beyond the limit set by you.
82
83              When the cache is full, curl closes the oldest one in the  cache
84              to prevent the number of open connections from increasing.
85
86              This  option  is for the multi handle's use only, when using the
87              easy interface you should instead  use  the  CURLOPT_MAXCONNECTS
88              option.
89
90              (Added in 7.16.3)
91

RETURNS

93       The  standard  CURLMcode  for multi interface error codes. Note that it
94       returns a CURLM_UNKNOWN_OPTION if you try setting an option  that  this
95       version of libcurl doesn't know of.
96

AVAILABILITY

98       This function was added in libcurl 7.15.4.
99

SEE ALSO

101       curl_multi_cleanup(3),     curl_multi_init(3),    curl_multi_socket(3),
102       curl_multi_info_read(3)
103
104
105
106libcurl 7.16.0                    10 Oct 2006             curl_multi_setopt(3)
Impressum