* @return resource IDs of active tunnels
*/
public Set<Integer> getActiveTunnels(SessionInfo session) {
try {
MultiplexedConnection tunnel = DefaultAgentManager.getInstance().getAgentBySession(session);
if (tunnel == null)
return null;
HashSet<Integer> activeTunnelIds = new HashSet<Integer>();
// The agent keeps track of 'local' tunnels
Request request = new Request(ACTIVE_LOCAL_TUNNELS);
if (tunnel.sendRequest(request, true) && request.getRequestData()!=null) {
ByteArrayReader reader = new ByteArrayReader(request.getRequestData());
int count = (int) reader.readInt();
for (int i = 0; i < count; i++) {
activeTunnelIds.add(new Integer((int) reader.readInt()));