Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 11.2   11.3   11.4   11.5   12.0   12.1   12.2   12.3   12.4   12.5    Statistic    FMM    Blog  

CURL.SetOptionMaxLifeTimeConnection

Sets maximum lifetime (since creation) allowed for reusing a connection.

Component Version macOS Windows Linux Server iOS SDK
CURL 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "CURL.SetOptionMaxLifeTimeConnection"; curl; value )   More

Parameters

Parameter Description Example
curl The CURL session handle. $curl
value The new maximum lifetime for a connection in seconds. 300

Result

Returns OK or error.

Description

Sets maximum lifetime (since creation) allowed for reusing a connection.
Pass a number as parameter containing maxlifetime - the maximum time in seconds, since the creation of the connection, that you allow an existing connection to have to be considered for reuse for this request.

libcurl features a connection cache that holds previously used connections. When a new request is to be done, it will consider any connection that matches for reuse. The MaxLifeTimeConnection limit prevents libcurl from trying too old connections for reuse. This can be used for client-side load balancing. If a connection is found in the cache that is older than this set maxlifetime, it will instead be closed once any in-progress transfers complete.

If set to 0, this behavior is disabled: all connections are eligible for reuse.

Release notes

Blog Entries

Created 22nd August 2022, last changed 22nd August 2022


CURL.SetOptionMaxFileSize - CURL.SetOptionMaxRecvSpeed

Feedback: Report problem or ask question.


Start Chat