Class AbstractIoSessionConfig

    • Constructor Detail

      • AbstractIoSessionConfig

        protected AbstractIoSessionConfig()
    • Method Detail

      • setAll

        public void setAll​(IoSessionConfig config)
        Sets all configuration properties retrieved from the specified config.
        Specified by:
        setAll in interface IoSessionConfig
        Parameters:
        config - The configuration to use
      • getReadBufferSize

        public int getReadBufferSize()
        Specified by:
        getReadBufferSize in interface IoSessionConfig
        Returns:
        the size of the read buffer that I/O processor allocates per each read. It's unusual to adjust this property because it's often adjusted automatically by the I/O processor.
      • setReadBufferSize

        public void setReadBufferSize​(int readBufferSize)
        Sets the size of the read buffer that I/O processor allocates per each read. It's unusual to adjust this property because it's often adjusted automatically by the I/O processor.
        Specified by:
        setReadBufferSize in interface IoSessionConfig
        Parameters:
        readBufferSize - The size of the read buffer
      • getMinReadBufferSize

        public int getMinReadBufferSize()
        Specified by:
        getMinReadBufferSize in interface IoSessionConfig
        Returns:
        the minimum size of the read buffer that I/O processor allocates per each read. I/O processor will not decrease the read buffer size to the smaller value than this property value.
      • setMinReadBufferSize

        public void setMinReadBufferSize​(int minReadBufferSize)
        Sets the minimum size of the read buffer that I/O processor allocates per each read. I/O processor will not decrease the read buffer size to the smaller value than this property value.
        Specified by:
        setMinReadBufferSize in interface IoSessionConfig
        Parameters:
        minReadBufferSize - The minimum size of the read buffer
      • getMaxReadBufferSize

        public int getMaxReadBufferSize()
        Specified by:
        getMaxReadBufferSize in interface IoSessionConfig
        Returns:
        the maximum size of the read buffer that I/O processor allocates per each read. I/O processor will not increase the read buffer size to the greater value than this property value.
      • setMaxReadBufferSize

        public void setMaxReadBufferSize​(int maxReadBufferSize)
        Sets the maximum size of the read buffer that I/O processor allocates per each read. I/O processor will not increase the read buffer size to the greater value than this property value.
        Specified by:
        setMaxReadBufferSize in interface IoSessionConfig
        Parameters:
        maxReadBufferSize - The maximum size of the read buffer
      • getIdleTime

        public int getIdleTime​(IdleStatus status)
        Specified by:
        getIdleTime in interface IoSessionConfig
        Parameters:
        status - The status for which we want the idle time (One of READER_IDLE, WRITER_IDLE or BOTH_IDLE)
        Returns:
        idle time for the specified type of idleness in seconds.
      • getIdleTimeInMillis

        public long getIdleTimeInMillis​(IdleStatus status)
        Specified by:
        getIdleTimeInMillis in interface IoSessionConfig
        Parameters:
        status - The status for which we want the idle time (One of READER_IDLE, WRITER_IDLE or BOTH_IDLE)
        Returns:
        idle time for the specified type of idleness in milliseconds.
      • setIdleTime

        public void setIdleTime​(IdleStatus status,
                                int idleTime)
        Sets idle time for the specified type of idleness in seconds.
        Specified by:
        setIdleTime in interface IoSessionConfig
        Parameters:
        status - The status for which we want to set the idle time (One of READER_IDLE, WRITER_IDLE or BOTH_IDLE)
        idleTime - The time in second to set
      • setWriteTimeout

        public void setWriteTimeout​(int writeTimeout)
        Sets write timeout in seconds.
        Specified by:
        setWriteTimeout in interface IoSessionConfig
        Parameters:
        writeTimeout - The timeout to set
      • isUseReadOperation

        public boolean isUseReadOperation()
        Specified by:
        isUseReadOperation in interface IoSessionConfig
        Returns:
        true if and only if IoSession.read() operation is enabled. If enabled, all received messages are stored in an internal BlockingQueue so you can read received messages in more convenient way for client applications. Enabling this option is not useful to server applications and can cause unintended memory leak, and therefore it's disabled by default.
      • setUseReadOperation

        public void setUseReadOperation​(boolean useReadOperation)
        Enables or disabled IoSession.read() operation. If enabled, all received messages are stored in an internal BlockingQueue so you can read received messages in more convenient way for client applications. Enabling this option is not useful to server applications and can cause unintended memory leak, and therefore it's disabled by default.
        Specified by:
        setUseReadOperation in interface IoSessionConfig
        Parameters:
        useReadOperation - true if the read operation is enabled, false otherwise
      • getThroughputCalculationInterval

        public int getThroughputCalculationInterval()
        Specified by:
        getThroughputCalculationInterval in interface IoSessionConfig
        Returns:
        the interval (seconds) between each throughput calculation. The default value is 3 seconds.
      • setThroughputCalculationInterval

        public void setThroughputCalculationInterval​(int throughputCalculationInterval)
        Sets the interval (seconds) between each throughput calculation. The default value is 3 seconds.
        Specified by:
        setThroughputCalculationInterval in interface IoSessionConfig
        Parameters:
        throughputCalculationInterval - The interval
      • getThroughputCalculationIntervalInMillis

        public long getThroughputCalculationIntervalInMillis()
        Specified by:
        getThroughputCalculationIntervalInMillis in interface IoSessionConfig
        Returns:
        the interval (milliseconds) between each throughput calculation. The default value is 3 seconds.