java.lang.Object
net.i2p.util.SimpleTimer2.TimedEvent
net.i2p.client.impl.SessionIdleTimer
All Implemented Interfaces:
Runnable

class SessionIdleTimerextends SimpleTimer2.TimedEvent
Reduce tunnels or shutdown the session on idle if so configured.
  • Field Details

    • MINIMUM_TIME

      public static final long MINIMUM_TIME
      Lower bound on the configured reduce and shutdown times, in milliseconds.
      See Also:
    • DEFAULT_REDUCE_TIME

      private static final long DEFAULT_REDUCE_TIME
      Default idle time before reducing tunnels.
      See Also:
    • DEFAULT_CLOSE_TIME

      private static final long DEFAULT_CLOSE_TIME
      Default idle time before closing the session.
      See Also:
    • _log

      private final Log _log
      Logger for the session idle timer.
    • _context

      private final I2PAppContext _context
      The app context.
    • _session

      private final I2PSessionImpl _session
      The session watched for idleness.
    • _reduceEnabled

      private final boolean _reduceEnabled
      True to reduce tunnels when the session idles.
    • _reduceQuantity

      private final int _reduceQuantity
      Tunnels to reduce by when the session idles.
    • _reduceTime

      private final long _reduceTime
      Idle time before the tunnels are reduced.
    • _shutdownEnabled

      private final boolean _shutdownEnabled
      True to close the session when it idles.
    • _shutdownTime

      private final long _shutdownTime
      Idle time before the session is closed.
    • _minimumTime

      private final long _minimumTime
      Shortest interval between the timer runs.
    • _lastActive

      private long _lastActive
      When the session was last active.
  • Constructor Details

    • SessionIdleTimer

      public SessionIdleTimer(I2PAppContext context, I2PSessionImpl session, boolean reduce, boolean shutdown)
      Construct a timer that reduces, shuts down, or both.
      Parameters:
      context - the application context supplying the timer and the log manager
      session - the session whose i2cp options supply the idle thresholds and the reduction quantity
      reduce - if true, cut the session's tunnel quantity back after the idle time
      shutdown - if true, close the session after the idle time
  • Method Details