Skip to content

CurlMultiHandler :: setMultiOption(constant, value)

Brian Boll edited this page Apr 22, 2018 · 1 revision

CurlMultiHandler :: setMultiOption(constant, value)

In addition to setting options for each individual handle or setting those same options for multiple handles, more options exist for how these requests are handled in parallel.

$mch = new CurlMultiHandler();
$ch = new CurlHandler('http://example.com');

$mch->addHandle($ch);

//Limit caching of connections to 10 at a time, closes oldest first when limit is reached
$mch->setMultiOption(CURLMOPT_MAXCONNECTS, 10);

$mch->execute();

Parameters [2]:

[1] constant: A constant representing one of the libcurl options for multi handles detailed more here

[2] value: The expected value for the corresponding option passed by the first parameter

Returns:

No return value

Clone this wiki locally