Package marauroa.server.net.nio
Class FloodCheck
java.lang.Object
marauroa.server.net.nio.FloodCheck
- All Implemented Interfaces:
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isFlooding(FloodMeasure entry)
Returns true if with the information stored an entry implementation determines that there is a flood attack.void
onFlood(FloodMeasure entry)
Called by FloodValidator when the connection is found to be flooding.
-
Constructor Details
-
FloodCheck
creates a new FloodChecker- Parameters:
netMan
- INetworkServerManager
-
-
Method Details
-
isFlooding
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 interfaceIFloodCheck
- Parameters:
entry
- Flood measures to help us take a decision- Returns:
- true if there is a flood from this entry.
-
onFlood
Description copied from interface:IFloodCheck
Called by FloodValidator when the connection is found to be flooding.- Specified by:
onFlood
in interfaceIFloodCheck
- Parameters:
entry
- the channel that is causing the flood.
-