Store them in a thread list.
ClientList: TThreadList<TIdTCPClient>;
Create one of these objects before you create any clients.
ClientList := TThreadList<TIdTCPClient>.Create;
Whenever you create a client, add it:
procedure ss_thread.Execute;
var
List: TList<TIdTCPClient>;
....
ws := TIdTCPClient.Create(nil);
List := ClientList.LockList;
try
List.Add(ws);
finally
ClientList.UnlockList;
end;
Whenever you need to iterate over the clients, you can do so like this:
var
List: TList<TIdTCPClient>;
Client: TIdTCPClient;
....
List := ClientList.LockList;
try
for Client in List do
// do something with Client
finally
ClientList.UnlockList;
end;
In the thread's destructor you will also need to remove the client from the list.