Andrea Matteo Serain escribió: > Server side question: can I obtain a reference to the connection(s) of > a client if i know his ID? I know I can use, if conn is an istance of > IConnection: > conn.getClient().getId(); > > Can I do the opposite? > something like: IConnection conn = getConnection(clientId). > Sure not the best way but without testing it i found this...
In ApplicationAdapter getClients() returns a Set<IClient> You can get an Iterator<IClient> from this Set<IClient> wiht iterator() method With next() method of Iterator<IClient> ( in a loop till !hasNext() ) you can get every IClient From every IClient you can get its ID with IClient.getId() You can compare the ID you're looking for with the returned ID of IClient.getId() If that ID is the one you're looking for you can get a Set<IConnections> from that IClient with IClient.getConnections() And so on... Am i doing something wrong? Is this the correct way to do it? IConnection conn = getConnection(clientId) would be much better, don't know if it is possible on a easier way... _______________________________________________ Red5 mailing list [email protected] http://osflash.org/mailman/listinfo/red5_osflash.org
