Class ServerExchangeThrottler

    • Constructor Detail

      • ServerExchangeThrottler

        public ServerExchangeThrottler()
        Creates a throttler with connection limits on user and total connections.
        Since:
        03.05.00
      • ServerExchangeThrottler

        public ServerExchangeThrottler​(int maxConnections)
        Creates a throttler with connection limits on user and total connections.
        Parameters:
        maxConnections - maximum allowed server connections
        Since:
        03.05.00
    • Method Detail

      • canIgnoreConnectionLimit

        public boolean canIgnoreConnectionLimit​(HttpExchange exchange)
        Returns if an exchange is exempt from the server connection limit only.
        Parameters:
        exchange - exchange to process
        Returns:
        if exchange ignores server connection limit
        Since:
        03.05.00
        See Also:
        HttpExchange
      • setMaxServerConnections

        public final void setMaxServerConnections​(int connections)
        Sets the maximum number of connections the server can have. A value of -1 means unlimited connections.
        Parameters:
        connections - maximum number of connections allowed on the server
        Since:
        03.05.00
        See Also:
        getMaxConnections(HttpExchange)
      • getMaxServerConnections

        public final int getMaxServerConnections()
        Returns the maximum number of connections the server can have.
        Returns:
        maximum number of connections allowed on th server
        Since:
        03.05.00
        See Also:
        setMaxServerConnections(int)