RRU*_*RUZ 10
您可以使用该Contexts属性获取客户端,然后使用IOHandler每个客户端发送消息.
Var
Clients : TList;
i : integer;
begin
if not Assigned(IdTCPServer1.Contexts) then exit;
Clients:=IdTCPServer1.Contexts.LockList;
try
for i := 0 to Clients.Count-1 do
try
TIdContext(Clients[i]).Connection.IOHandler.Write(LBuffer);//LBuffer is a TBytes with the data to send
except
...
end;
finally
IdTCPServer1.Contexts.UnlockList;
end;
end;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2143 次 |
| 最近记录: |