public interface IoSessionConfig
IoSession
.限定符和类型 | 方法和说明 |
---|---|
int |
getBothIdleTime() |
long |
getBothIdleTimeInMillis() |
int |
getIdleTime(IdleStatus status) |
long |
getIdleTimeInMillis(IdleStatus status) |
int |
getMaxReadBufferSize() |
int |
getMinReadBufferSize() |
int |
getReadBufferSize() |
int |
getReaderIdleTime() |
long |
getReaderIdleTimeInMillis() |
int |
getThroughputCalculationInterval() |
long |
getThroughputCalculationIntervalInMillis() |
int |
getWriterIdleTime() |
long |
getWriterIdleTimeInMillis() |
int |
getWriteTimeout() |
long |
getWriteTimeoutInMillis() |
boolean |
isUseReadOperation() |
void |
setAll(IoSessionConfig config)
Sets all configuration properties retrieved from the specified
config.
|
void |
setBothIdleTime(int idleTime)
Sets idle time for
IdleStatus.WRITER_IDLE in seconds. |
void |
setIdleTime(IdleStatus status,
int idleTime)
Sets idle time for the specified type of idleness in seconds.
|
void |
setMaxReadBufferSize(int maxReadBufferSize)
Sets the maximum size of the read buffer that I/O processor
allocates per each read.
|
void |
setMinReadBufferSize(int minReadBufferSize)
Sets the minimum size of the read buffer that I/O processor
allocates per each read.
|
void |
setReadBufferSize(int readBufferSize)
Sets the size of the read buffer that I/O processor allocates
per each read.
|
void |
setReaderIdleTime(int idleTime)
Sets idle time for
IdleStatus.READER_IDLE in seconds. |
void |
setThroughputCalculationInterval(int throughputCalculationInterval)
Sets the interval (seconds) between each throughput calculation.
|
void |
setUseReadOperation(boolean useReadOperation)
Enables or disabled
IoSession.read() operation. |
void |
setWriterIdleTime(int idleTime)
Sets idle time for
IdleStatus.WRITER_IDLE in seconds. |
void |
setWriteTimeout(int writeTimeout)
Sets write timeout in seconds.
|
int getReadBufferSize()
void setReadBufferSize(int readBufferSize)
readBufferSize
- The size of the read bufferint getMinReadBufferSize()
void setMinReadBufferSize(int minReadBufferSize)
minReadBufferSize
- The minimum size of the read bufferint getMaxReadBufferSize()
void setMaxReadBufferSize(int maxReadBufferSize)
maxReadBufferSize
- The maximum size of the read bufferint getThroughputCalculationInterval()
long getThroughputCalculationIntervalInMillis()
void setThroughputCalculationInterval(int throughputCalculationInterval)
throughputCalculationInterval
- The intervalint getIdleTime(IdleStatus status)
status
- The status for which we want the idle time (One of READER_IDLE,
WRITER_IDLE or BOTH_IDLE)long getIdleTimeInMillis(IdleStatus status)
status
- The status for which we want the idle time (One of READER_IDLE,
WRITER_IDLE or BOTH_IDLE)void setIdleTime(IdleStatus status, int idleTime)
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 setint getReaderIdleTime()
IdleStatus.READER_IDLE
in seconds.long getReaderIdleTimeInMillis()
IdleStatus.READER_IDLE
in milliseconds.void setReaderIdleTime(int idleTime)
IdleStatus.READER_IDLE
in seconds.idleTime
- The time to setint getWriterIdleTime()
IdleStatus.WRITER_IDLE
in seconds.long getWriterIdleTimeInMillis()
IdleStatus.WRITER_IDLE
in milliseconds.void setWriterIdleTime(int idleTime)
IdleStatus.WRITER_IDLE
in seconds.idleTime
- The time to setint getBothIdleTime()
IdleStatus.BOTH_IDLE
in seconds.long getBothIdleTimeInMillis()
IdleStatus.BOTH_IDLE
in milliseconds.void setBothIdleTime(int idleTime)
IdleStatus.WRITER_IDLE
in seconds.idleTime
- The time to setint getWriteTimeout()
long getWriteTimeoutInMillis()
void setWriteTimeout(int writeTimeout)
writeTimeout
- The timeout to setboolean isUseReadOperation()
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.void setUseReadOperation(boolean useReadOperation)
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.useReadOperation
- true if the read operation is enabled, false otherwisevoid setAll(IoSessionConfig config)
config
- The configuration to use