Home > other >  Datasnap remove expired sessions Delphi
Datasnap remove expired sessions Delphi

Time:11-14

an app created for the mechanics of a company is controlled through the datasnap windows service active on the server. Now, these mechanics are often on the road and disconnect from the server. When the technician opens the app again and connects to the service, a new session is created and the old session is not deleted. This results that there is an accumulation of expired sessions that are not removed. how can I make sure the expired sessions are removed?

If I forgot some information please let me know and I add it to the question.

CodePudding user response:

After some documentation form embarcadero I've added the following to my DSTCPServerTransport.OnConnect event:

 Event.Channel.EnableKeepAlive(30000);

where 30000 the amount of milliseconds is.

on my client-side i added the following to my FDConnection.Onrecover event:

AAction := TFDPhysConnectionRecoverAction.faRetry;

This solves my problem with the unused sessions.

  • Related