org.klomp.snark

## Class IdleChecker

- java.lang.Object
- - net.i2p.util.SimpleTimer2.TimedEvent
  - - org.klomp.snark.IdleChecker

- All Implemented Interfaces:
    Runnable

      class IdleChecker
      extends SimpleTimer2.TimedEvent

  Periodically check for idle condition based on connected peers, and reduce/restore tunnel count as necessary. We can't use the I2CP idle detector because it's based on traffic, so DHT and announces would keep it non-idle.

- - ### Field Summary

    - ### Fields inherited from class net.i2p.util.SimpleTimer2.TimedEvent

      `_state, DEFAULT_FUZZ`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IdleChecker(SnarkManager mgr, PeerCoordinatorSet pcs)` Caller must schedule

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getActiveInboundCount()` Return the current inbound tunnel count
    `int` | `getActiveOutboundCount()` Return the current outbound tunnel count
    `void` | `timeReached()` Simple interface for events to be queued up and notified on expiration the time requested has been reached (this call should NOT block, otherwise the whole SimpleTimer gets backed up)

    - ### Methods inherited from class net.i2p.util.SimpleTimer2.TimedEvent

      `cancel, forceReschedule, reschedule, reschedule, run, schedule, setFuzz, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### IdleChecker

          public IdleChecker(SnarkManager mgr,
                             PeerCoordinatorSet pcs)

      Caller must schedule

  - ### Method Detail

    - #### getActiveInboundCount

          public int getActiveInboundCount()

      Return the current inbound tunnel count

    - #### getActiveOutboundCount

          public int getActiveOutboundCount()

      Return the current outbound tunnel count

    - #### timeReached

          public void timeReached()

      Description copied from class: `SimpleTimer2.TimedEvent`
      Simple interface for events to be queued up and notified on expiration the time requested has been reached (this call should NOT block, otherwise the whole SimpleTimer gets backed up)
      Specified by:
        `timeReached` in class `SimpleTimer2.TimedEvent`