Package org.klomp.snark
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
downloaded(int size)
We unconditionally received this many byteslong
getDownBWLimit()
Current limit in BPSlong
getDownloadRate()
The average rate in Bpslong
getUpBWLimit()
Current limit in BPSlong
getUploadRate()
The average rate in Bpsboolean
overDownBWLimit()
Are we currently over the limit?boolean
overUpBWLimit()
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 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?
-
-