You are not logged in.
Pages: 1
How to implement the SOA Service without GUI/Console/Service?
program FishShopDaemon;
uses
....
mORMot;
begin
fServer := TSQLRestServerFullMemory.CreateWithOwnModel([], False, FISHSHOP_ROOT);
fServer.ServiceDefine(instance, [IFishShop], FISHSHOP_CONTRACT);
fHttpServer := TSQLHttpServer.Create(FISHSHOP_PORT, fServer);
??????? -> repeat until application.processMessages?
fServer.Free;
fHttpServer.Free;
end.
Offline
You can use a daemon as mentioned by mpv to run in the background.
If you want the console window to be visible, use a WriteLn()...
begin
...
fHttpServer := TSQLHttpServer.Create(FISHSHOP_PORT, fServer);
try
writeln('Server running. Press any key to stop...');
finaly
fHttpServer.Free;
....
end;
end.
Offline
Service (TSynDaemon) executable can be also launched in console mode with the /console parameter, like
YourService.exe /console
It might be useful, for example, for service debugging from Delphi with the corresponding property in project options:
<Debugger_RunParams>/console</Debugger_RunParams>
Offline
Sorry, my mistake. I would like to create invisible client instance (>100 instances).
So, does the deamon helps me or use the while true Application.ProcessMessages;
program FishShopDaemon;
uses
....
mORMot;
begin
connector := TSQLHttpClientWebsockets.Create('127.0.0.1', '1414', TSQLModel.Create([]), False, '', '', 30000, 30000, 30000);
connector.WebSocketsUpgrade(myPassword);
if not connector.ServerTimeStampSynchronize then
raise EServiceException.Create('Error connecting to the server');
connector.ServiceDefine([IService],sicShared);
if not connector.Services.Resolve(IService,Service) then
raise EServiceException.Create('Service unavailable');
??????? -> repeat until application.processMessages?
connector.Free;
end.
Offline
Pages: 1