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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisFlooding(FloodMeasure entry)Returns true if with the information stored an entry implementation determines that there is a flood attack.voidonFlood(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:IFloodCheckReturns true if with the information stored an entry implementation determines that there is a flood attack.- Specified by:
isFloodingin 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:IFloodCheckCalled by FloodValidator when the connection is found to be flooding.- Specified by:
onFloodin interfaceIFloodCheck- Parameters:
entry- the channel that is causing the flood.
-