I hav some code I want to use in a plugin for external application. The thing is, when I use TThread (TServerHandlerThread), and put some infinite loop, then the application does not respond - only the code of the TServerHandlerThread thread works. Is there any way to make it work? The plugin will be used in X-Plane 11 simulator.
procedure TServerHandlerThread.Execute;
begin
FCon := TLTcp.Create(nil);
FCon.OnError := @OnEr;
FCon.OnReceive := @OnRe;
FCon.OnDisconnect := @OnDs;
FCon.OnAccept := @OnAc;
FCon.Timeout := 100;
FCon.ReuseAddress := True;
if FCon.Listen(30123) then begin
repeat
FCon.Callaction;
Sleep(100);
until Quit;
end;
FCon.Free;
end;