This commit is contained in:
Алексей Заблоцкий 2023-10-19 14:08:42 +03:00
parent f6fb6db5d7
commit 675fa2a89a
5 changed files with 30 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@ -6,14 +6,22 @@
<General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="Daemon application"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<MacroValues Count="1">
<Macro1 Name="LCLWidgetType" Value="nogui"/>
</MacroValues>
<BuildModes>
<Item Name="Default" Default="True"/>
<SharedMatrixOptions Count="1">
<Item1 ID="700255898348" Modes="Default" Type="IDEMacro" MacroName="LCLWidgetType" Value="nogui"/>
</SharedMatrixOptions>
</BuildModes>
<PublishOptions>
<Version Value="2"/>

BIN
lmsreport

Binary file not shown.

View File

@ -17,6 +17,15 @@ type
fFields: TStrings;
fCommand: string;
fOnComplete: TRequestComplete;
fResult :TCommandData;
fmode: byte;
fCode:DWORD;
fValue:QWORD;
fAnswer: string;
fValues: TStrings;
fResData: TStream;
fResArray: TParamArray;
procedure SynchAnswer;
public
property Host: string read fHost;
property Command: string read fCommand write fCommand;
@ -36,6 +45,12 @@ type
end;
implementation
procedure TClientMainThread.SynchAnswer;
begin
fOnComplete(self,fmode,fResult.code,fResult.Param,fResult.Name,fResult.Keys,fResult.iValues,fResult.Data);
end;
constructor TClientMainThread.Create(ACommand: string; AFields: TStrings;
ALogger: TLogger; AHost: string; APort: integer; OnReceive: TRequestComplete);
begin
@ -83,7 +98,13 @@ procedure TClientMainThread.ProcessAnswer(const mode: byte; const Code: DWORD;
begin
try
if assigned(fOnComplete) then
fOnComplete(self,mode,code,qValue,Answer,Values,iValues,Data);
begin
fResult := TCommandData.Create(code,qValue,answer,Values,iValues,Data);
fMode := mode;
Synchronize(@SynchAnswer);
end;
except on e:Exception do
begin