Module SimpleHttpServer
Class SessionThrottler
java.lang.Object
dev.katsute.simplehttpserver.handler.throttler.SessionThrottler
A throttler that limits the amount of simultaneous connections based on the session.
- Since:
- 5.0.0
- Version:
- 5.0.0
- Author:
- Katsute
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getMaxConnections
(HttpSession session, SimpleHttpExchange exchange) Returns the maximum number of connections allowed for a session.final int
getMaxConnections
(SimpleHttpExchange exchange) Returns the maximum number of connections allowed for an exchange.toString()
-
Constructor Details
-
SessionThrottler
Creates a throttler.- Parameters:
sessionHandler
- session handler- Since:
- 5.0.0
- See Also:
-
-
Method Details
-
getMaxConnections
Returns the maximum number of connections allowed for an exchange. Return-1
for unlimited connections.- Parameters:
exchange
- exchange- Returns:
- maximum connections
- See Also:
-
getMaxConnections
Returns the maximum number of connections allowed for a session. Return-1
for unlimited connections.- Parameters:
session
- sessionexchange
- exchange- Returns:
- maximum connections
- Since:
- 5.0.0
- See Also:
-
toString
-