You are not logged in.
Pages: 1
Both Synopse sockets and websockets seem to implement KeepAlive mechanism.
I'm using WebSockets and I'd like to make use of KeepAlive to detect disconnects.
I tried playing with the available properties but could not get it to do anything.
I assume that once connection is established any subsequent disconnect should be detected after keepAlive period expires.
So, what do I have to do/set for KeepAlive to be in use ?
Offline
KeepAlive is for HTTP. It is just a wish from the client to not have the connection closed for a given time.
But most Web servers do close the connection after a while or a number of messages.
Then the connection is quickly re-opened at TCP level.
WebSockets have a more coherent mechanism, with proper disconnection and regular ping/pong messages to check the connection.
It will really keep alive the connection.
By default, if you use TSQLHttpClientWebsockets, this mechanism will be built-in.
If you want easy disconnection detection, e.g. to reconfigure some services when using asynchronous callbacks, check TDDDRestClientWebSockets from dddInfraApps.pas. Inherit from it, then override the DefineApplication and RegisterServices virtual methods.
Offline
Pages: 1