fix build on windows

This commit is contained in:
2026-05-02 13:39:46 +03:00
parent e9d6b70de9
commit 0480c73f3f
3 changed files with 32 additions and 16 deletions
+10 -9
View File
@@ -20,13 +20,14 @@ unit CATTcp;
interface
uses
Classes, SysUtils, SyncObjs,
Classes, SysUtils,
WebUtils, // SockClose, SockShutdown, SOCK_INVALID
{$IFDEF MSWINDOWS}
Windows, WinSock2
Windows, WinSock2,
{$ELSE}
BaseUnix, Sockets
{$ENDIF},
BaseUnix, Sockets,
{$ENDIF}
SyncObjs,
CATEngine;
const
@@ -251,23 +252,23 @@ end;
procedure TCATTcpClientThread.SendData(const Msg: string; const IdLimit: TStringList);
var
i: Integer;
send: Boolean;
i: Integer;
doSend: Boolean;
begin
if IdLimit = nil then begin
SendStr(Msg);
Exit;
end;
send := False;
doSend := False;
FIdLock.Acquire;
try
for i := 0 to FClientIds.Count-1 do
if IdLimit.IndexOf(FClientIds[i]) >= 0 then begin
send := True;
doSend := True;
Break;
end;
finally FIdLock.Release; end;
if send then SendStr(Msg);
if doSend then SendStr(Msg);
end;
function TCATTcpClientThread.IsMarkedForDelete: Boolean;