Class ConnectionLimit

All Implemented Interfaces:
EventListener, Connection.Listener, SelectorManager.AcceptListener, SelectorManager.SelectorManagerListener, LifeCycle

A Listener that limits the number of Connections.

This listener applies a limit to the number of connections, which when exceeded results in a call to AbstractConnector.setAccepting(boolean) to prevent further connections being received. 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 ConnectionLimit(5000,server));
   ...
   server.start();
 
See Also: