Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old


Sets whether to not reuse old connections.

Component Version macOS Windows Linux Server iOS SDK
CURL 2.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "CURL.SetOptionFreshConnect"; curl; Value )   More


Parameter Description Example
curl The CURL session handle. $curl
Value Whether to not reuse old connection for next transfer. 0


Returns "OK" on success.


Sets whether to not reuse old connections.
Set to 1 to make the next transfer use a new (fresh) connection by force. If the connection cache is full before this connection, one of the existing connections will be closed as according to the selected or default policy. This option should be used with caution and only if you understand what it does. Set this to 0 to have libcurl attempt re-using an existing connection (default behavior).
see also CURL.SetOptionForbidReuse.

See also FRESH_CONNECT option in CURL manual.


Request a fresh connection:

Set Variable [$r; Value: MBS( "CURL.SetOptionFreshConnect"; $curl; 1 )]

Forbit reuse and make fresh connection:

Set Variable [$EmailID; Value: MBS( "CURL.SetOptionForbidReuse"; $curl; 1 ) ]
Set Variable [$EmailID; Value: MBS( "CURL.SetOptionFreshConnect"; $curl; 1 ) ]

Require new connection every 20 emails:

Set Variable [ $r; Value: MBS("CURL.SetOptionFreshConnect"; $curl; Mod ( GetAsNumber ( $count ) ; 20 ) = 0 ]

See also

Example Databases

Created 18th August 2014, last changed 16th February 2024

CURL.SetOptionForbidReuse - CURL.SetOptionGSSAPIDelegation