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 Detail

      • 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?