アクティブなクライアント接続にアクセスするには、Connections プロパティを使用してリストを反復処理し、クライアント接続クラスにアクセスします。Connections プロパティはスレッド化されたリストにアクセスするため、まずリストをロックし、完了したらロックを解除してください。
procedure DoClientIPAddresses;
var
i: Integer;
oList: TList;
oConnection: TsgcWSConnectionServer;
begin
oList := TsgcWebSocketHTTPServer1.LockList;
Try
for i := 0 to oList.Count - 1 do
begin
oConnection := TsgcWSConnectionServer(TIdContext(oList[i]).Data);
ShowMessage(oConnection.IP + ':' + IntToStr(oConnection.Port));
end;
Finally
TsgcWebSocketHTTPServer1.UnLockList;
End;
end;