- java.lang.Object
-
- com.kttdevelopment.simplehttpserver.handler.SessionThrottler
-
public class SessionThrottler extends Object
Limits connections per http session. This can be used to limit simultaneous downloads.- Since:
- 03.03.00
- Version:
- 03.05.01
- Author:
- Ktt Development
- See Also:
HttpSession,ThrottledHandler,ExchangeThrottler,ServerExchangeThrottler,ServerSessionThrottler
-
-
Constructor Summary
Constructors Constructor Description SessionThrottler(HttpSessionHandler sessionHandler)Creates a throttler that allows no connections.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMaxConnections(HttpSession session, HttpExchange exchange)Returns the maximum number of connections for a session.intgetMaxConnections(HttpExchange exchange)Returns the maximum number of connections for an exchange.StringtoString()
-
-
-
Constructor Detail
-
SessionThrottler
public SessionThrottler(HttpSessionHandler sessionHandler)
Creates a throttler that allows no connections.- Parameters:
sessionHandler- session handler- Since:
- 03.03.00
- See Also:
HttpSessionHandler
-
-
Method Detail
-
getMaxConnections
public final int getMaxConnections(HttpExchange exchange)
Returns the maximum number of connections for an exchange. A value of-1means unlimited connections.- Parameters:
exchange- exchange to process- Returns:
- maximum number of connections allowed
- See Also:
HttpExchange,addConnection(HttpExchange),deleteConnection(HttpExchange)
-
getMaxConnections
public int getMaxConnections(HttpSession session, HttpExchange exchange)
Returns the maximum number of connections for a session. A value of-1means unlimited connections.- Parameters:
session- session to processexchange- exchange to process- Returns:
- maximum number of connections allowed
- Since:
- 03.05.00
-
-