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.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConnThrottler(int max, int totalMax, long period, SimpleTimer2 timer)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) boolean` | `isOverBy(Hash h, int over)` Checks if individual count is over the limit by this much.
    `(package private) boolean` | `isThrottled(Hash h)` Checks individual count only.
    `(package private) boolean` | `shouldThrottle(Hash h)` Checks both individual and total.
    `void` | `updateLimits(int max, int totalMax)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ConnThrottler

          ConnThrottler(int max,
                        int totalMax,
                        long period,
                        SimpleTimer2 timer)

  - ### Method Detail

    - #### isOverBy

          boolean isOverBy(Hash h,
                           int over)

      Checks if individual count is over the limit by this much. Does not increment.

    - #### isThrottled

          boolean isThrottled(Hash h)

      Checks individual count only. Does not increment.

    - #### shouldThrottle

          boolean shouldThrottle(Hash h)

      Checks both individual and total. Increments before checking.

    - #### updateLimits

          public void updateLimits(int max,
                                   int totalMax)