Code:
Procedure TForm1.Button2Click(Sender: TObject);
var
List: TList;
Index: integer;
begin
List := IdTCPServer1.Threads.LockList;
try
for Index := 0 to List.Count-1 do
begin
with TIdPeerThread(List[Index]).Connection do
begin
WriteLn('STOP');
Readln();
end;
end;
finally
IdTCPServer1.Threads.UnlockList;
end;
end;
Procedure TForm1.Button2Click(Sender: TObject);
var
List: TList;
Index: integer;
begin
List := IdTCPServer1.Threads.LockList;
try
for Index := 0 to List.Count-1 do
begin
with TIdPeerThread(List[Index]).Connection do
begin
WriteLn('STOP');
Readln();
end;
end;
finally
IdTCPServer1.Threads.UnlockList;
end;
end;
Server mi se zablokira ili veliki delay. Postoji li neki elegantniji nacin za slanje poruke svim klijentima?
Hvala.