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

CURL.SetOptionTCPKeepAlive

Enable TCP keep-alive probing.

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

Parameters

Parameter Description Example
curl The CURL session handle. $curl
Value The new setting. 1 = on and 0 = off. 1

Result

Returns OK or error.

Description

Enable TCP keep-alive probing.
If set to 1, TCP keep alive probes will be sent to avoid TCP/IP timeouts. The delay and frequency of these probes can be controlled by the CURL.SetOptionTCPKeepIdle and CURL.SetOptionTCPKeepInterval options, provided the operating system supports them. Set to 0 (default behavior) to disable keep alive probes.

See also TCP_KEEPALIVE option in CURL manual.

Examples

Configure keep alive:

#Enable TCP keep-alive for this transfer
Set Variable [$r; Value:MBS( "CURL.SetOptionTCPKeepAlive"; $curl; 1 )]
#keep-alive idle time to 60 seconds
Set Variable [$r; Value:MBS( "CURL.SetOptionTCPKeepIdle"; $curl; 60 )]
#interval time between keep-alive probes: 30 seconds
Set Variable [$r; Value:MBS( "CURL.SetOptionTCPKeepInterval"; $curl; 30 )]

See also

Blog Entries

Created 8th July 2015, last changed 30th November 2021


CURL.SetOptionTCPFastOpen - CURL.SetOptionTCPKeepIdle