@Override
        public void run() {

            // Get current time
            long now = System.currentTimeMillis();

            // For each tunnel, close and remove any tunnels which have expired
            Iterator<Map.Entry<String, GuacamoleHTTPTunnel>> entries = tunnelMap.entrySet().iterator();
            while (entries.hasNext()) {

                Map.Entry<String, GuacamoleHTTPTunnel> entry = entries.next();
                GuacamoleHTTPTunnel tunnel = entry.getValue();

                // Get elapsed time since last access
                long age = now - tunnel.getLastAccessedTime();

                // If tunnel is too old, close and remove it
                if (age >= tunnelTimeout) {

                    // Remove old entry
                    logger.debug("HTTP tunnel \"{}\" has timed out.", entry.getKey());
                    entries.remove();

                    // Attempt to close tunnel
                    try {
                        tunnel.close();
                    }
                    catch (GuacamoleException e) {
                        logger.debug("Unable to close expired HTTP tunnel.", e);
                    }

                }

            } // end for each tunnel

        }
Creates a new task which automatically closes and removes tunnels
which have not been accessed for at least the given number of
milliseconds.

@param tunnelTimeout
    The maximum amount of time to allow between separate tunnel
    read/write requests, in milliseconds.
guacamole-common/src/main/java/org/apache/guacamole/servlet/GuacamoleHTTPTunnelMap.java