<pclass="level0">curl_multi_setopt() is used to tell a libcurl multi handle how to behave. By using the appropriate options to <aclass="emphasis"href="./curl_multi_setopt.html">curl_multi_setopt(3)</a>, you can change libcurl's behaviour when using that multi handle. All options are set with the <spanClass="emphasis">option</span> followed by the parameter <spanClass="emphasis">param</span>. That parameter can be a <spanClass="bold">long</span>, a <spanClass="bold">function pointer</span>, an <spanClass="bold">object pointer</span> or a <spanClass="bold">curl_off_t</span> type, depending on what the specific option expects. Read this manual carefully as bad input values may cause libcurl to behave badly! You can only set one option in each function call.
<pclass="level1">Pass a pointer to a function matching the <spanClass="bold">curl_socket_callback</span> prototype. The <aclass="emphasis"href="./curl_multi_socket.html">curl_multi_socket(3)</a> functions inform the application about updates in the socket (file descriptor) status by doing none, one or multiple calls to the curl_socket_callback given in the <spanClass="bold">param</span> argument. They update the status with changes since the previous time a <aclass="emphasis"href="./curl_multi_socket.html">curl_multi_socket(3)</a> function was called. If the given callback pointer is NULL, no callback will be called. Set the callback's <spanClass="bold">userp</span> argument with <aclass="emphasis"href="#CURLMOPTSOCKETDATA">CURLMOPT_SOCKETDATA</a>. See <aclass="emphasis"href="./curl_multi_socket.html">curl_multi_socket(3)</a> for more callback details.
<pclass="level1">Pass a pointer to whatever you want passed to the <spanClass="bold">curl_socket_callback</span>'s forth argument, the userp pointer. This is not used by libcurl but only passed-thru as-is. Set the callback pointer with <aclass="emphasis"href="#CURLMOPTSOCKETFUNCTION">CURLMOPT_SOCKETFUNCTION</a>.
<pclass="level1">Pass a long set to 1 to enable or 0 to disable. Enabling pipelining on a multi handle will make it attempt to perform HTTP Pipelining as far as possible for transfers using this handle. This means that if you add a second request that can use an already existing connection, the second request will be "piped" on the same connection rather than being executed in parallell. (Added in 7.16.0)
<pclass="level1">Pass a pointer to a function matching the <spanClass="bold">curl_multi_timer_callback</span> prototype. This function will then be called when the timeout value changes. The timeout value is at what latest time the application should call one of the "performing" functions of the multi interface (<aclass="emphasis"href="./curl_multi_socket.html">curl_multi_socket(3)</a>, <aclass="emphasis"href="./curl_multi_socket_all.html">curl_multi_socket_all(3)</a> and <aclass="emphasis"href="./curl_multi_perform.html">curl_multi_perform(3)</a>) - to allow libcurl to keep timeouts and retries etc to work. A timeout value of -1 means that there is no timeout at all, and 0 means that the timeout is already reached. Libcurl attempts to limit calling this only when the fixed future timeout time actually changes. See also <aclass="emphasis"href="#CURLMOPTTIMERDATA">CURLMOPT_TIMERDATA</a>. This callback can be used instead of, or in addition to, <aclass="emphasis"href="./curl_multi_timeout.html">curl_multi_timeout(3)</a>. (Added in 7.16.0)
<pclass="level1">Pass a pointer to whatever you want passed to the <spanClass="bold">curl_multi_timer_callback</span>'s third argument, the userp pointer. This is not used by libcurl but only passed-thru as-is. Set the callback pointer with <aclass="emphasis"href="#CURLMOPTTIMERFUNCTION">CURLMOPT_TIMERFUNCTION</a>. (Added in 7.16.0)
<pclass="level1">Pass a long. The set number will be used as the maximum amount of simultaneously open connections that libcurl may cache. Default is 10, and libcurl will enlarge the size for each added easy handle to make it fit 4 times the number of added easy handles.
<pclass="level1">This option is for the multi handle's use only, when using the easy interface you should instead use the <spanClass="emphasis">CURLOPT_MAXCONNECTS</span> option.
<pclass="level1">(Added in 7.16.3) <aname="RETURNS"></a><h2class="nroffsh">RETURNS</h2>
<pclass="level0">The standard CURLMcode for multi interface error codes. Note that it returns a CURLM_UNKNOWN_OPTION if you try setting an option that this version of libcurl doesn't know of. <aname="AVAILABILITY"></a><h2class="nroffsh">AVAILABILITY</h2>
<pclass="level0">This function was added in libcurl 7.15.4. <aname="SEE"></a><h2class="nroffsh">SEE ALSO</h2>