You are not logged in.
Hello,
I want to be able to detect when the server has gone away. The client hangs when the server is shutdown and I want to try an display a notice of that event but I've been unable to find something I can poll to see the current state of the connection.
I initially tried polling the ServerTimeStampSynchronize function. The client would lock up before that could return. Then I attempted to look at the ServerInternalState variable value, but the client still locks before I can act upon it and it doesn't appear to update when the server is shutdown.
Is there some event that is fired on the client side when a connection interruption happens? So I can more gracefully capture it and act upon it?
I've played some with changing the timeouts on my TSQLHttpClientWebsockets.Create but this did not seem to help the situation.
Thank you in advance.
Offline
Has anyone else ran into this issue?
I also need to know this so I can handle if I've lost connection to the server to somehow cache the data being transacted locally and then feed it to the server once I'm able to talk to it again. But if my application hangs when the server goes away I'm unable to create a solution for this. Any guidance would be greatly appreciated.
Offline
I think, you should use ServerTimeStampSynchronize, but just set the timeout when creating the client, for example, if in 0.5 second the ServerTimeStampSynchronize would not return, the connection would considered broken.
Hope it helps.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Has anyone else ran into this issue?
>I also need to know this so I can handle if I've lost connection to the server to somehow cache the data being transacted locally and then feed it to the server once I'm able to talk to it again. But if my application hangs when the server goes away I'm unable to create a solution for this. Any guidance would be greatly appreciated.
I'm thinking of doing this by opening a websocket. The server will (probably) close the socket when it goes down gracefully, or the socket will close in time if the network connection fails (assuming keepalives).
E
Offline