Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

curl_multi_setopt

Description

The curl_multi_setopt of cURL for PHP set an option for the cURL multi handle.

Syntax

curl_multi_setopt ( resource $mh , int $option , mixed $value ) : bool

Parameters

mh

option

One of the CURLMOPT_* constants.

value

The value to be set on option. value should be an int for the following values of the option parameter:

OptionValue
CURLMOPT_PIPELININGPass 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. As of cURL 7.43.0, the value is a bitmask, and you can also pass 2 to try to multiplex the new transfer over an existing HTTP/2 connection if possible. Passing 3 instructs cURL to ask for pipelining and multiplexing independently of each other. As of cURL 7.62.0, setting the pipelining bit has no effect. Instead of integer literals, you can also use the CURLPIPE_* constants if available.
CURLMOPT_MAXCONNECTSPass a number that will be used as the maximum amount of simultaneously open connections that libcurl may cache. By default the size will be enlarged to fit four times the number of handles added via curl_multi_add_handle(). When the cache is full, curl closes the oldest one in the cache to prevent the number of open connections from increasing.
CURLMOPT_CHUNK_LENGTH_PENALTY_SIZEPass a number that specifies the chunk length threshold for pipelining in bytes.
CURLMOPT_CONTENT_LENGTH_PENALTY_SIZEPass a number that specifies the size threshold for pipelining penalty in bytes.
CURLMOPT_MAX_HOST_CONNECTIONSPass a number that specifies the maximum number of connections to a single host.
CURLMOPT_MAX_PIPELINE_LENGTHPass a number that specifies the maximum number of requests in a pipeline.
CURLMOPT_MAX_TOTAL_CONNECTIONSPass a number that specifies the maximum number of simultaneously open connections.
CURLMOPT_PUSHFUNCTIONPass a callable that will be registered to handle server pushes and should have the following signature:pushfunction ( resource $parent_ch , resource $pushed_ch , array $headers ) : intparent_ch

The parent cURL handle (the request the client made).

pushed_ch

A new cURL handle for the pushed request.

headers

The push promise headers.

The push function is supposed to return either CURL_PUSH_OK if it can handle the push, or CURL_PUSH_DENY to reject it.

Return

Returns TRUE on success or FALSE on failure.

HomeMenu