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

CURL.SetOptionConnectTimeoutMS

Sets the connection timeout in milliseconds.

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

Parameters

Parameter Description Example
curl The CURL session handle. $curl
Value The connection timeout time in milliseconds. 300000

Result

Returns "OK" on success.

Description

Sets the connection timeout in milliseconds.
Like CURL.SetOptionConnectionTimeout but takes the number of milliseconds instead. If libcurl is built to use the standard system name resolver, that portion of the connect will still use full-second resolution for timeouts with a minimum timeout allowed of one second.

See also CONNECTTIMEOUT_MS option in CURL manual.

Examples

Enable advanced logging to debug a problem:

# Trace to file with times
Set Variable [ $r; Value: MBS( "Trace"; "/tmp/mbs.log" )
Set Variable [ $r; Value: MBS( "Trace.SetWithTimes"; 1 )
#
# Debug log for CURL with additional data:
Set Variable [ $r; Value: MBS( "CURL.SetDebugWithTime"; $curl; 1 )
Set Variable [ $r; Value: MBS( "CURL.SetDebugWithProgress"; $curl; 1 )
#
# and define some timeouts
Set Variable [ $r; Value: MBS( "CURL.SetOptionConnectTimeoutMS"; $curl; 10000 )

See also

Created 18th August 2014, last changed 18th December 2021


CURL.SetOptionConnectOnly - CURL.SetOptionConnectTo