public class FIFOBandwidthLimiter extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
FIFOBandwidthLimiter.CompleteListener |
static interface |
FIFOBandwidthLimiter.Request
A bandwidth request, either inbound or outbound.
|
Constructor and Description |
---|
FIFOBandwidthLimiter(I2PAppContext context) |
Modifier and Type | Method and Description |
---|---|
int |
getCurrentParticipatingBandwidth()
Out bandwidth.
|
int |
getInboundBurstBytes() |
int |
getInboundBurstKBytesPerSecond()
The configured maximum, not the current rate
|
int |
getInboundKBytesPerSecond()
The configured maximum, not the current rate
|
int |
getOutboundBurstBytes() |
int |
getOutboundBurstKBytesPerSecond()
The configured maximum, not the current rate
|
int |
getOutboundKBytesPerSecond()
The configured maximum, not the current rate
|
float |
getReceiveBps() |
float |
getReceiveBps15s() |
float |
getSendBps() |
float |
getSendBps15s() |
(package private) StringBuilder |
getStatus() |
long |
getTotalAllocatedInboundBytes() |
long |
getTotalAllocatedOutboundBytes() |
long |
now() |
(package private) void |
refillBandwidthQueues(List<FIFOBandwidthLimiter.Request> buf,
long bytesInbound,
long bytesOutbound,
long maxBurstIn,
long maxBurstOut)
More bytes are available - add them to the queue and satisfy any requests
we can
|
void |
reinitialize() |
void |
renderStatusHTML(Writer out)
Deprecated.
not worth translating
|
FIFOBandwidthLimiter.Request |
requestInbound(int bytesIn,
String purpose)
Request some bytes.
|
FIFOBandwidthLimiter.Request |
requestOutbound(int bytesOut,
int priority,
String purpose)
Request some bytes.
|
void |
sentParticipatingMessage(int size)
We sent a message.
|
(package private) void |
setInboundBurstBytes(int bytes) |
(package private) void |
setInboundBurstKBps(int kbytesPerSecond) |
(package private) void |
setInboundUnlimited(boolean isUnlimited)
Deprecated.
unused for now, we are always limited
|
(package private) void |
setOutboundBurstBytes(int bytes) |
(package private) void |
setOutboundBurstKBps(int kbytesPerSecond) |
(package private) void |
setOutboundUnlimited(boolean isUnlimited)
Deprecated.
unused for now, we are always limited
|
void |
shutdown() |
public FIFOBandwidthLimiter(I2PAppContext context)
public long now()
public long getTotalAllocatedInboundBytes()
public long getTotalAllocatedOutboundBytes()
@Deprecated void setInboundUnlimited(boolean isUnlimited)
@Deprecated 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 void shutdown()
public void sentParticipatingMessage(int size)
size
- bytespublic int getCurrentParticipatingBandwidth()
public FIFOBandwidthLimiter.Request requestInbound(int bytesIn, String purpose)
public FIFOBandwidthLimiter.Request requestOutbound(int bytesOut, int priority, String purpose)
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)
buf
- contains satisfied outbound requests, really just to avoid object thrash, not really usedmaxBurstIn
- 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)@Deprecated public void renderStatusHTML(Writer out) throws IOException
IOException