Class ConnectionThrottleFilter

    • Constructor Detail

      • ConnectionThrottleFilter

        public ConnectionThrottleFilter()
        Default constructor. Sets the wait time to 1 second
      • ConnectionThrottleFilter

        public ConnectionThrottleFilter​(long allowedInterval)
        Constructor that takes in a specified wait time.
        Parameters:
        allowedInterval - The number of milliseconds a client is allowed to wait before making another successful connection
    • Method Detail

      • setAllowedInterval

        public void setAllowedInterval​(long allowedInterval)
        Sets the interval between connections from a client. This value is measured in milliseconds.
        Parameters:
        allowedInterval - The number of milliseconds a client is allowed to wait before making another successful connection
      • isConnectionOk

        protected boolean isConnectionOk​(IoSession session)
        Method responsible for deciding if a connection is OK to continue
        Parameters:
        session - The new session that will be verified
        Returns:
        True if the session meets the criteria, otherwise false