I am trying to make an Asynchronous HTTP request by his code:
http = CreateObject(“roUrlTransfer”)
port = CreateObject(“roMessagePort”)
http.SetPort(port)
http.SetUrl(“http://mysite.com”) ’ should return response in up to 30 seconds.
’ SSL certicate, a must for HTTPS addresses !
http.SetCertificatesFile(“common:/certs/ca-bundle.crt”)
What if you lower the time for the response for testing? Maybe try 1 second, see if that works, then try 5 seconds, 10, 15, 20, until it fails? If it always fails then that will indicate perhaps the response itself is the problem…or could be the certificate.
“liran” wrote:
The response is shown at the browser, after 30 seconds max (on purpose).
This is why I want to handle it asynchronously, and it doesn’t work.
I seem to recall, in my testing, there being a built-in 30 second timeout in the roUrlTransfer component, but I’m not 100% sure about that. I’d definitely try what destruk suggests. Your code also appears to be missing the call to InitClientCertificates which could also be causing a problem.
The time-out is not from the server ! Even when I define at the server to response after 1 second, at the browser the response is gotten after 1 second - My code get stuck at:
message = wait(0,port)
Until about 30~ seconds have passed, the message doesn’t get to the port or something.