Package net.i2p.client.streaming.impl
Class ConnThrottler
- java.lang.Object
- 
- net.i2p.client.streaming.impl.ConnThrottler
 
- 
 class ConnThrottler extends Object Count how often we have received an incoming connection This offers basic DOS protection but is not a complete solution.- Since:
- 0.7.14
 
- 
- 
Constructor SummaryConstructors Constructor Description ConnThrottler(int max, int totalMax, long period, SimpleTimer2 timer)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) booleanisOverBy(Hash h, int over)Checks if individual count is over the limit by this much.(package private) booleanisThrottled(Hash h)Checks individual count only.(package private) booleanshouldThrottle(Hash h)Checks both individual and total.voidupdateLimits(int max, int totalMax)
 
- 
- 
- 
Constructor Detail- 
ConnThrottlerConnThrottler(int max, int totalMax, long period, SimpleTimer2 timer)
 
- 
 - 
Method Detail- 
updateLimitspublic void updateLimits(int max, int totalMax)
 - 
shouldThrottleboolean shouldThrottle(Hash h) Checks both individual and total. Increments before checking.
 - 
isThrottledboolean isThrottled(Hash h) Checks individual count only. Does not increment.- Since:
- 0.9.3
 
 - 
isOverByboolean isOverBy(Hash h, int over) Checks if individual count is over the limit by this much. Does not increment.- Since:
- 0.9.34
 
 
- 
 
-