## net.i2p.router
Class RouterDoSThrottle

    java.lang.Object
      net.i2p.router.RouterThrottleImpl
          net.i2p.router.RouterDoSThrottle

All Implemented Interfaces:
  RouterThrottle

class RouterDoSThrottle
extends RouterThrottleImpl

Minor extention of the router throttle to handle some DoS events and throttle accordingly.

Field Summary
`static int` `TUNNEL_ACCEPT` tunnel acceptance

Constructor Summary
`RouterDoSThrottle(RouterContext context)`

Method Summary
`boolean` `acceptNetDbLookupRequest(Hash key)` Should we accept the netDb lookup message, replying either with the value or some closer peers, or should we simply drop it due to overload?
`boolean` `acceptNetworkMessage()` Should we accept any more data from the network for any sort of message, taking into account our current load, or should we simply slow down?
`int` `acceptTunnelRequest()` Should we accept the request to participate in the given tunnel, taking into account our current load and bandwidth usage commitments?
`protected RouterContext` `getContext()`
`double` `getInboundRateDelta()` How much faster (or if negative, slower) we are receiving data as opposed to our longer term averages?
`long` `getMessageDelay()` How backed up we are at the moment processing messages (in milliseconds)
`long` `getTunnelLag()` How backed up our tunnels are at the moment (in milliseconds)

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TUNNEL_ACCEPT

    public static final int TUNNEL_ACCEPT

  tunnel acceptance

  See Also:
    Constant Field Values

Constructor Detail

### RouterDoSThrottle

    public RouterDoSThrottle(RouterContext context)

Method Detail

### acceptNetDbLookupRequest

    public boolean acceptNetDbLookupRequest(Hash key)

  Description copied from interface: `RouterThrottle`
  Should we accept the netDb lookup message, replying either with the value or some closer peers, or should we simply drop it due to overload?

  Specified by:
    `acceptNetDbLookupRequest` in interface `RouterThrottle`
  Overrides:
    `acceptNetDbLookupRequest` in class `RouterThrottleImpl`

### acceptNetworkMessage

    public boolean acceptNetworkMessage()

  Description copied from interface: `RouterThrottle`
  Should we accept any more data from the network for any sort of message, taking into account our current load, or should we simply slow down?

  Specified by:
    `acceptNetworkMessage` in interface `RouterThrottle`

### acceptTunnelRequest

    public int acceptTunnelRequest()

  Description copied from interface: `RouterThrottle`
  Should we accept the request to participate in the given tunnel, taking into account our current load and bandwidth usage commitments?

  Specified by:
    `acceptTunnelRequest` in interface `RouterThrottle`
  Returns:
    0 if it should be accepted, higher values for more severe rejection

### getMessageDelay

    public long getMessageDelay()

  Description copied from interface: `RouterThrottle`
  How backed up we are at the moment processing messages (in milliseconds)

  Specified by:
    `getMessageDelay` in interface `RouterThrottle`

### getTunnelLag

    public long getTunnelLag()

  Description copied from interface: `RouterThrottle`
  How backed up our tunnels are at the moment (in milliseconds)

  Specified by:
    `getTunnelLag` in interface `RouterThrottle`

### getInboundRateDelta

    public double getInboundRateDelta()

  Description copied from interface: `RouterThrottle`
  How much faster (or if negative, slower) we are receiving data as opposed to our longer term averages?

  Specified by:
    `getInboundRateDelta` in interface `RouterThrottle`

### getContext

    protected RouterContext getContext()