1curl_multi_setopt(3) libcurl Manual curl_multi_setopt(3)
2
3
4
6 curl_multi_setopt - set options for a curl multi handle
7
9 #include <curl/curl.h>
10
11 CURLMcode curl_multi_setopt(CURLM * multi_handle, CURLMoption option,
12 param);
13
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
26 CURLMOPT_SOCKETFUNCTION
27 Pass a pointer to a function matching the curl_socket_callback
28 prototype. The curl_multi_socket(3) functions inform the appli‐
29 cation about updates in the socket (file descriptor) status by
30 doing none, one or multiple calls to the curl_socket_callback
31 given in the param argument. They update the status with changes
32 since the previous time a curl_multi_socket(3) function was
33 called. If the given callback pointer is NULL, no callback will
34 be called. Set the callback's userp argument with CURLMOPT_SOCK‐
35 ETDATA. See curl_multi_socket(3) for more callback details.
36
37 CURLMOPT_SOCKETDATA
38 Pass a pointer to whatever you want passed to the
39 curl_socket_callback's forth argument, the userp pointer. This
40 is not used by libcurl but only passed-thru as-is. Set the call‐
41 back pointer with CURLMOPT_SOCKETFUNCTION.
42
43 CURLMOPT_PIPELINING
44 Pass a long set to 1 to enable or 0 to disable. Enabling pipe‐
45 lining on a multi handle will make it attempt to perform HTTP
46 Pipelining as far as possible for transfers using this handle.
47 This means that if you add a second request that can use an
48 already existing connection, the second request will be "piped"
49 on the same connection rather than being executed in parallell.
50 (Added in 7.16.0)
51
52 CURLMOPT_TIMERFUNCTION
53 Pass a pointer to a function matching the curl_multi_timer_call‐
54 back prototype. This function will then be called when the
55 timeout value changes. The timeout value is at what latest time
56 the application should call one of the "performing" functions of
57 the multi interface (curl_multi_socket(3),
58 curl_multi_socket_all(3) and curl_multi_perform(3)) - to allow
59 libcurl to keep timeouts and retries etc to work. Libcurl
60 attempts to limit calling this only when the fixed future time‐
61 out time actually change. See also CURLMOPT_TIMERDATA. This
62 callback can be used instead of, or in addition to,
63 curl_multi_timeout(3). (Added in 7.16.0)
64
65 CURLMOPT_TIMERDATA
66 Pass a pointer to whatever you want passed to the
67 curl_multi_timer_callback's third argument, the userp pointer.
68 This is not used by libcurl but only passed-thru as-is. Set the
69 callback pointer with CURLMOPT_TIMERFUNCTION. (Added in 7.16.0)
70
71 CURLMOPT_MAXCONNECTS
72 Pass a long. The set number will be used as the maximum amount
73 of simultaneously open connections that libcurl may cache.
74 Default is 10, and libcurl will enlarge the size for each added
75 easy handle to make it fit 4 times the number of added easy han‐
76 dles.
77
78 By setting this option, you can prevent the cache size to grow
79 beyond the limit set by you.
80
81 When the cache is full, curl closes the oldest one in the cache
82 to prevent the number of open connections to increase.
83
84 This option is for the multi handle's use only, when using the
85 easy interface you should instead use the CURLOPT_MAXCONNECTS
86 option.
87
88 (Added in 7.16.3)
89
91 The standard CURLMcode for multi interface error codes. Note that it
92 returns a CURLM_UNKNOWN_OPTION if you try setting an option that this
93 version of libcurl doesn't know of.
94
96 This function was added in libcurl 7.15.4.
97
99 curl_multi_cleanup(3), curl_multi_init(3), curl_multi_socket(3),
100 curl_multi_info_read(3)
101
102
103
104libcurl 7.16.0 10 Oct 2006 curl_multi_setopt(3)