|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > HTP. - Command > HTP. - HTTP Operations |
SPR Script Language
HTP.SetConTO
Sets the connection timeout for HTTP operations in milliseconds.
Intention
The HTP.SetConTO command in SPR configures the timeout for establishing a connection in HTTP operations, such as those performed by HTP.Request or HTP.ReqShort. You specify the timeout in milliseconds ($$MS), or omit it to reset to the default connect timeout. This controls how long your script waits to connect to a server before giving up.
It’s your robot’s handshake timer—HTP.SetConTO sets how long it waits to say hello to the server.
Illustration
⏱️ Set Connect Timeout: HTP.SetConTO|4000 sets a 4-second connection timeout.
🔄 Reset: HTP.SetConTO restores the default connect timeout.
Syntax
HTP.SetConTO|$$MS
Parameter Explanation
P1 - $$MS - (Variable, Numeric, Optional)
The connection timeout in milliseconds (e.g., $$MS as "4000"). If omitted, resets to the default stored in g_connect.
Examples
'***********************************
' HTP.SetConTO - Sample 1: Set 4-Second Connect Timeout
'***********************************
HTP.SetConTO|4000
MBX.Connect timeout set to 4 seconds
HTP.Request|GET|https://example.com|||0|0|0|$$RES
MBX.Ready
'
'***********************************
' HTP.SetConTO - Sample 2: Reset to Default
'***********************************
HTP.SetConTO
PRT.Connect timeout reset to default
MBX.Ready
'
Remarks
- Sets the connection timeout for subsequent HTTP operations.
- Omitting $$MS resets to the default stored in g_connect.
- Affects the connection establishment phase of HTTP requests.
Limitations
- No success confirmation; assumes HTP_SetConnectTimeout succeeds.
- Default value depends on initial g_connect setting.
See also: