net.i2p.router.transport
public class FIFOBandwidthLimiter extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
FIFOBandwidthLimiter.CompleteListener |
static interface |
FIFOBandwidthLimiter.Request
This is somewhat complicated by having both
inbound and outbound in a single request.
|
Constructor and Description |
---|
FIFOBandwidthLimiter(I2PAppContext context) |
public FIFOBandwidthLimiter(I2PAppContext context)
public long now()
public long getTotalAllocatedInboundBytes()
public long getTotalAllocatedOutboundBytes()
public long getTotalWastedInboundBytes()
public long getTotalWastedOutboundBytes()
public boolean getInboundUnlimited()
public void setInboundUnlimited(boolean isUnlimited)
public boolean getOutboundUnlimited()
public void setOutboundUnlimited(boolean isUnlimited)
public float getSendBps()
public float getReceiveBps()
public float getSendBps15s()
public float getReceiveBps15s()
public int getOutboundKBytesPerSecond()
public int getInboundKBytesPerSecond()
public int getOutboundBurstKBytesPerSecond()
public int getInboundBurstKBytesPerSecond()
public void reinitialize()
public FIFOBandwidthLimiter.Request createRequest()
public FIFOBandwidthLimiter.Request requestInbound(int bytesIn, String purpose)
public FIFOBandwidthLimiter.Request requestInbound(int bytesIn, String purpose, FIFOBandwidthLimiter.CompleteListener lsnr, Object attachment)
public FIFOBandwidthLimiter.Request requestOutbound(int bytesOut, String purpose)
public FIFOBandwidthLimiter.Request requestOutbound(int bytesOut, String purpose, FIFOBandwidthLimiter.CompleteListener lsnr, Object attachment)
void setInboundBurstKBps(int kbytesPerSecond)
void setOutboundBurstKBps(int kbytesPerSecond)
public int getInboundBurstBytes()
public int getOutboundBurstBytes()
void setInboundBurstBytes(int bytes)
void setOutboundBurstBytes(int bytes)
StringBuilder getStatus()
final void refillBandwidthQueues(List<FIFOBandwidthLimiter.Request> buf, long bytesInbound, long bytesOutbound, long maxBurstIn, long maxBurstOut)
maxBurstIn
- allow up to this many bytes in from the burst section for this time period (may be negative)maxBurstOut
- allow up to this many bytes in from the burst section for this time period (may be negative)public void renderStatusHTML(Writer out) throws IOException
IOException