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: 12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4   13.5    Statistic    FMM    Blog  

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

💬 Ask a question or report a problem