Class AcceptRateLimit

All Implemented Interfaces:
Runnable, EventListener, SelectorManager.AcceptListener, SelectorManager.SelectorManagerListener, LifeCycle

@ManagedObject public class AcceptRateLimit extends AbstractLifeCycle implements SelectorManager.AcceptListener, Runnable

A Listener that limits the rate at which new connections are accepted

If the limits are exceeded, accepting is suspended until the rate is again below the limit, so incoming connections are held in the operating system accept queue (no syn ack sent), where they may either timeout or wait for the server to resume accepting.

It can be applied to an entire server or to a specific connector by adding it via Container.addBean(Object)

Usage:

   Server server = new Server();
   server.addBean(new AcceptLimit(100,5,TimeUnit.SECONDS,server));
   ...
   server.start();
 
See Also: