You are not logged in.
Pages: 1
Hi Arnaud, I'm getting closer to deploying my application using your object to json technology and remote client/server access.
When I lose an internet connection, it takes quite some time for a timeout to occur and in the meantime my application is blocked. Ordinarily I don't mind the application being blocked as most calls are getting or posting data and these are generally quick and need to be synchronous to ensure transactional integrity within the app.
I was considering putting in a thread that sends a pingtest to the server every few seconds so I could show an LED indicator as red or green depending on connectivity. Is there a way to get that to return almost immediately if the comms are down but yet keep a reasonable timeout for the normal server calls which can take a bit longer to respond?
If I were to use an Indy component to ping the server would I need to deploy a separate indy web service on a different port on the server or is there a way I can use the mormot server from indy or can that be avoided altogether by overriding the normal timeout for these 'pingtest' calls?
Thanks
Paul
Offline
Issue with such a ping test is that the dedicated test server may be online, but the communication with the main HTTP server may be broken...
So your ping may success, and not HTTP communication.
If you use WinINet / WinHTTP connection, there is a known issue about time out, AFAIK.
See http://stackoverflow.com/questions/11583798
A dedicated thread for communication is needed here.
If you use THttpClientSocket direct socket connection (i.e. TSQLite3HttpClientWinSock class as TSQLRestClientURI), you have a TimeOut property (in milliseconds) which can be reduce to avoid application wait...
Offline
Pages: 1