This question is actually about the HTTP module, not INet. Anyhow...
How reliable is the HTTP timeout system in the command "cHTTP_Client.SetTimeouts"? I think I have it properly set up in my script, but there's times when the script just hangs forever after a "<cHTTP_Client>.Send(requestBody)" statement. If the server doesn't reply after the specified amount of seconds, does it just keep retrying or is it supposed to return an error code, end the script, or what?
Just to be clear. My script works fine when the server responds. It just sits forever at the .Send statement if the server is not responding. Here's a code fragment showing what I am doing...
' Create fresh HTTP request object for each attempt
httpRequest = New ServerXMLHTTPRequest
' Set timeouts to prevent hanging (all in milliseconds)
' Parameters: resolveTimeout, connectTimeout, sendTimeout, receiveTimeout
httpRequest.setTimeouts(15000, 20000, 30000, 30000) ' 15, 20, 30, 30 seconds
Printl "Setting up request with timeouts..."
' Make polling request
Printl "httpRequest.Open( GET , pollUrl$, %FALSE)"
httpRequest.Open("GET", pollUrl$, %FALSE)
printl "httpRequest.Send() with timeout protection..."
httpRequest.Send()
apiResponse$ = httpRequest.ResponseText
Printl "Response received, length: " & Str$(Len(apiResponse$))
file_Save("hf_api_reply_step2_" & Str$(fileCounter) & ".txt", apiResponse$)