java.lang.Object
org.klomp.snark.PeerCheckerTask
All Implemented Interfaces:
Runnable

class PeerCheckerTaskextends Object implements Runnable
TimerTask that checks for good/bad up/downloader. Works together with the PeerCoordinator to select which Peers get (un)choked.
  • Field Details

    • KILOPERSECOND

      private static final long KILOPERSECOND
      Transfer rate implied by one check per period, in bytes per second.
      See Also:
    • coordinator

      private final PeerCoordinator coordinator
      The coordinator whose peers are checked.
    • _util

      private final I2PSnarkUtil _util
      The torrent the peers belong to.
    • _log

      private final Log _log
      Logger for this class.
    • random

      private final Random random
      Chooses which peers to check.
    • _runCount

      private int _runCount
      How many times the task has run.
  • Constructor Details

    • PeerCheckerTask

      PeerCheckerTask(I2PSnarkUtil util, PeerCoordinator coordinator)
      Creates a new checker task for the given coordinator.
      Parameters:
      util - the snark utility
      coordinator - the coordinator to check
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable