Class DefaultNetherServerThrottle
java.lang.Object
org.cloudburstmc.netty.channel.nethernet.config.DefaultNetherServerThrottle
- All Implemented Interfaces:
NetherServerThrottle
Limits the connections open from one address and the joins it may start per window, like RakNet's
DefaultRakServerThrottle. IPv6 addresses count per /64, which one host usually holds whole.-
Constructor Summary
ConstructorsConstructorDescription10 open connections and 3 joins per 4 seconds per address.DefaultNetherServerThrottle(int connectionsMax, long connectWindowInMs, int connectsMax) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(InetSocketAddress address) voidclosed(InetSocketAddress address)
-
Constructor Details
-
DefaultNetherServerThrottle
public DefaultNetherServerThrottle()10 open connections and 3 joins per 4 seconds per address. -
DefaultNetherServerThrottle
public DefaultNetherServerThrottle(int connectionsMax, long connectWindowInMs, int connectsMax)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceNetherServerThrottle- Parameters:
address- The address the peer signaled from- Returns:
- Whether the join may go ahead. An accepted join is followed by
NetherServerThrottle.closed(java.net.InetSocketAddress)once its connection closes.
-
closed
- Specified by:
closedin interfaceNetherServerThrottle- Parameters:
address- The address a join was accepted for
-