Class FloodCheck

java.lang.Object
marauroa.server.net.nio.FloodCheck
All Implemented Interfaces:
IFloodCheck

public class FloodCheck extends Object implements IFloodCheck
A basic implementation of a flooding check. We check that client doesn't send us more than 1024 bytes per second or more than 20 messages per second. If this happen, we warn client ( well, in fact we don't ), and at the third time it happens we consider this a flooding.
Author:
miguel
  • Constructor Details

    • FloodCheck

      public FloodCheck(INetworkServerManager netMan)
      creates a new FloodChecker
      Parameters:
      netMan - INetworkServerManager
  • Method Details

    • isFlooding

      public boolean isFlooding(FloodMeasure entry)
      Description copied from interface: IFloodCheck
      Returns true if with the information stored an entry implementation determines that there is a flood attack.
      Specified by:
      isFlooding in interface IFloodCheck
      Parameters:
      entry - Flood measures to help us take a decision
      Returns:
      true if there is a flood from this entry.
    • onFlood

      public void onFlood(FloodMeasure entry)
      Description copied from interface: IFloodCheck
      Called by FloodValidator when the connection is found to be flooding.
      Specified by:
      onFlood in interface IFloodCheck
      Parameters:
      entry - the channel that is causing the flood.