|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > HTP. - Command > !HTP-General - General HTTP operations and utilities > !Configuration - Commands for setting up HTTP environment (timeouts, headers, proxy) > HTP. - HTTP Operations |
SPR Script Language
HTP.SetRcvTO
Sets the receive timeout for HTTP operations in milliseconds.
Intention
The HTP.SetRcvTO command in SPR configures the timeout for receiving data 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 receive timeout. This controls how long your script waits for a server response before timing out.
It’s your robot’s reply waiter—HTP.SetRcvTO sets how long it waits for the server to send data back.
Illustration
⏱️ Set Receive Timeout: HTP.SetRcvTO|8000 sets an 8-second receive timeout.
🔄 Reset: HTP.SetRcvTO restores the default receive timeout.
Syntax
HTP.SetRcvTO|$$MS
Parameter Explanation
P1 - $$MS - (Variable, Numeric, Optional)
The receive timeout in milliseconds (e.g., $$MS as "8000"). If omitted, resets to the default stored in g_receive.
Examples
'***********************************
' HTP.SetRcvTO - Sample 1: Set 8-Second Receive Timeout
'***********************************
HTP.SetRcvTO|8000
MBX.Receive timeout set to 8 seconds
HTP.Request|GET|https://example.com|||0|0|0|$$RES
MBX.Ready
'
'***********************************
' HTP.SetRcvTO - Sample 2: Reset to Default
'***********************************
HTP.SetRcvTO
PRT.Receive timeout reset to default
MBX.Ready
'
Remarks
- Sets the receive timeout for subsequent HTTP operations.
- Omitting $$MS resets to the default stored in g_receive.
- Affects the data reception phase of HTTP requests.
Limitations
- No success confirmation; assumes HTP_SetReceiveTimeout succeeds.
- Default value depends on initial g_receive setting.
See also: