Interface BandwidthListener

All Known Implementing Classes:
BandwidthManager, Peer, PeerCoordinator, WebPeer

public interface BandwidthListener
Bandwidth and bandwidth limits Maintain three bandwidth estimators: Sent, received, and requested.
Since:
0.9.62
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    downloaded(int size)
    We unconditionally received this many bytes
    long
    Current limit in BPS
    long
    The average rate in Bps
    long
    Current limit in BPS
    long
    The average rate in Bps
    boolean
    Are we currently over the limit?
    boolean
    Are we currently over the limit?
    boolean
    shouldRequest(Peer peer, int size)
    Should we request this many bytes?
    boolean
    shouldSend(int size)
    Should we send this many bytes? Do NOT call uploaded() if this returns true.
    void
    uploaded(int size)
    We unconditionally sent this many bytes
  • Method Details

    • getUploadRate

      long getUploadRate()
      The average rate in Bps
    • getDownloadRate

      long getDownloadRate()
      The average rate in Bps
    • uploaded

      void uploaded(int size)
      We unconditionally sent this many bytes
    • downloaded

      void downloaded(int size)
      We unconditionally received this many bytes
    • shouldSend

      boolean shouldSend(int size)
      Should we send this many bytes? Do NOT call uploaded() if this returns true.
    • shouldRequest

      boolean shouldRequest(Peer peer, int size)
      Should we request this many bytes?
    • getUpBWLimit

      long getUpBWLimit()
      Current limit in BPS
    • getDownBWLimit

      long getDownBWLimit()
      Current limit in BPS
    • overUpBWLimit

      boolean overUpBWLimit()
      Are we currently over the limit?
    • overDownBWLimit

      boolean overDownBWLimit()
      Are we currently over the limit?