Jump to content
alank2

TNetHTTPClient timeout / delay

Recommended Posts

I am using TNetHTTPClient and have set its timeouts (ConnectionTimeout, ResponseTimeout, and SendTimeout) to 6000 each for 6 seconds.

 

I have a virtual machine that has an odd thing going on - if I start it (or restart it), the first time I launch the application that uses TNetHTTPClient, it will take a long time (231 seconds), but it will eventually return what is expected (no errors, no exceptions thrown).

 

If I close the application and launch it again (without restarting the VM), it works as it should <400ms.

 

I do have a feeling that the VM itself, for some reason, is causing this delay, but why doesn't TNetHTTPClient timeout properly?

 

I found this:

https://stackoverflow.com/questions/56416108/connection-timeout-with-tnethttpclient-and-delphi-10-3

 

Suggesting there is no resolve timeout, but I created a ping shortcut on the desktop to the URL I am connecting to with TNetHTTPClient and double clicked it as soon as the system was restarted.  It resolved immediately and this made no difference to the 231 seconds one the program starts up for the first time.

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×