java.lang.Object
net.i2p.i2ptunnel.ConnThrottler.Record
- Enclosing class:
ConnThrottler
Keep a list of seen times, and a ban-until time. Caller must sync all methods.
Field Summary
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionvoidban(long untilTime) Throttles this peer until the given time.intcountSince(long time) Counts this peer's connections since the given time, dropping the older ones.longgetUntil()When this peer's throttle expires.voidCaller must synch.
Field Details
times
until
private long untilWhen this peer's throttle expires.
Constructor Details
Record
public Record()Builds an empty record for one peer.
Method Details
countSince
public int countSince(long time) Counts this peer's connections since the given time, dropping the older ones. Caller must synch.- Parameters:
time- drop the connections before this time- Returns:
- the connections counted since then
increment
public void increment()Caller must synch.ban
public void ban(long untilTime) Throttles this peer until the given time. Caller must synch.- Parameters:
untilTime- when the throttle expires
getUntil
public long getUntil()When this peer's throttle expires. Caller must synch.- Returns:
- the expiry time, 0 if not throttled