主循环
procedure ServiceController(CtrlCode: DWord); stdcall;
begin
WatchService.Controller(CtrlCode);
end;
function TWatchService.GetServiceController: TServiceController;
begin
Result := ServiceController;
end;
procedure TWatchService.ServiceExecute(Sender: TService);
begin
while not Terminated do
begin
ServiceThread.ProcessRequests(False);
Sleep(100);
end;
ServerSocket1.Active := False;
end;