#1 mORMot 2 » How to increase rest server object life time » 2024-10-14 10:41:29

DelphiSoul
Replies: 1

Hi, thanks for the great work and sorry for my English.

I need to implement server object with very expensive (time consuming) creation, wich i suppose to reuse from call to call. Also its not thread safe, so I believe the sicPerThread creation model is suitable.
I also need a client for this server implemented in Delphi 7.

I encountered two issues:

a) The KeepAliveTimeout is hardcoded to 30 sec in module mormot.rest.http.server:

 

fHttpServer := HTTPSERVERSOCKETCLASS[aUse].Create(fPort, HttpThreadStart, HttpThreadTerminate, TrimU(fRestServerNames), aThreadPoolCount, 30000, hso)

  Session terminates and destroys my object after 30 sec while i need something about one-two hours. Maybe I'm doing something wrong? Why hardcode?


b) Client compiled with Delphi 7 terminates the previous session for each call (while the same code, compiled with Delphi 10.4 works fine).

Do you have any suggestions to achieve my goals?

Thank You.

Board footer

Powered by FluxBB