You are not logged in.
Pages: 1
hello!
I have a little console project rest server with mormot2, it can be deadlock some times(no any response when client connecting), it is good when keying enter key,What could be the possible reason?
I make source to service project , It's well.
No any waiting a key in my source.
Mormot 2.3, Delphi12.2
Last edited by songshuang (2024-11-16 09:14:19)
Offline
The above issues is well sometimes,sometimes occured.
Writeln('hello word');
myhttpsvr := TTmyServer.Create;
try
Writeln('Press enter to close');
ConsoleWaitForEnterKey;
finally
Writeln('stopping...');
FreeAndNil(myhttpsvr);
Writeln('svr stoppeded.');
end;
Sometimes showing
hello word
Press enter to close
...
20241118 08131854 + mormot.db.raw.sqlite3.TSqlDatabase(e741f0).DBOpen SQLCY.db
...
Sometimes showing
...
20241118 08233147 http mormot.rest.http.server.TRestHttpServer(02f2a2e0) http.sys registration of http://+:7302//
hello word
Press enter to close
so, I may have some understanding now
Offline
Difficult to know what is wrong in your code.
Some ideas:
- First step is to move your startup code out of "Create" and put it into a dedicated method like "Run".
- Use a try..except and show any exception during this "Run" method call.
Offline
Pages: 1