net.i2p.router.tunnel.pool

## Class RequestThrottler

- java.lang.Object
- - net.i2p.router.tunnel.pool.RequestThrottler

-     class RequestThrottler
      extends Object

  Throttles incoming tunnel requests earlier than ParticipatingThrottler, with higher limits and more frequent cleanup. Checks various router characteristics and decides whether to throttle, ban, or disconnect routers based on request count, version, bandwidth, country, and system load. Now includes burst detection with sliding window to detect DDoS attacks that attempt to overwhelm the router with rapid successive requests.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RequestThrottler(RouterContext ctx)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) boolean` | `shouldThrottle(Hash h)` Checks if the given router's tunnel requests should be throttled.

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

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

- - ### Constructor Detail

    - #### RequestThrottler

          RequestThrottler(RouterContext ctx)

  - ### Method Detail

    - #### shouldThrottle

          boolean shouldThrottle(Hash h)

      Checks if the given router's tunnel requests should be throttled. Increments the request count and evaluates limits, router capabilities, blocking policies, version, and system load to decide throttling.
      Parameters:
        `h` - the router's hash
      Returns:
        true if the request should be throttled (denied), false otherwise