public abstract class AbstractIoSessionConfig extends java.lang.Object implements IoSessionConfig
IoSessionConfig
.限定符 | 构造器和说明 |
---|---|
protected |
AbstractIoSessionConfig() |
限定符和类型 | 方法和说明 |
---|---|
protected abstract void |
doSetAll(IoSessionConfig config)
Implement this method to set all transport-specific configuration
properties retrieved from the specified config.
|
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.
|
public final void setAll(IoSessionConfig config)
setAll
在接口中 IoSessionConfig
config
- The configuration to useprotected abstract void doSetAll(IoSessionConfig config)
config
- the IoSessionConfig
to setpublic int getReadBufferSize()
getReadBufferSize
在接口中 IoSessionConfig
public void setReadBufferSize(int readBufferSize)
setReadBufferSize
在接口中 IoSessionConfig
readBufferSize
- The size of the read bufferpublic int getMinReadBufferSize()
getMinReadBufferSize
在接口中 IoSessionConfig
public void setMinReadBufferSize(int minReadBufferSize)
setMinReadBufferSize
在接口中 IoSessionConfig
minReadBufferSize
- The minimum size of the read bufferpublic int getMaxReadBufferSize()
getMaxReadBufferSize
在接口中 IoSessionConfig
public void setMaxReadBufferSize(int maxReadBufferSize)
setMaxReadBufferSize
在接口中 IoSessionConfig
maxReadBufferSize
- The maximum size of the read bufferpublic int getIdleTime(IdleStatus status)
getIdleTime
在接口中 IoSessionConfig
status
- The status for which we want the idle time (One of READER_IDLE,
WRITER_IDLE or BOTH_IDLE)public long getIdleTimeInMillis(IdleStatus status)
getIdleTimeInMillis
在接口中 IoSessionConfig
status
- The status for which we want the idle time (One of READER_IDLE,
WRITER_IDLE or BOTH_IDLE)public void setIdleTime(IdleStatus status, int idleTime)
setIdleTime
在接口中 IoSessionConfig
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 setpublic final int getBothIdleTime()
getBothIdleTime
在接口中 IoSessionConfig
IdleStatus.BOTH_IDLE
in seconds.public final long getBothIdleTimeInMillis()
getBothIdleTimeInMillis
在接口中 IoSessionConfig
IdleStatus.BOTH_IDLE
in milliseconds.public final int getReaderIdleTime()
getReaderIdleTime
在接口中 IoSessionConfig
IdleStatus.READER_IDLE
in seconds.public final long getReaderIdleTimeInMillis()
getReaderIdleTimeInMillis
在接口中 IoSessionConfig
IdleStatus.READER_IDLE
in milliseconds.public final int getWriterIdleTime()
getWriterIdleTime
在接口中 IoSessionConfig
IdleStatus.WRITER_IDLE
in seconds.public final long getWriterIdleTimeInMillis()
getWriterIdleTimeInMillis
在接口中 IoSessionConfig
IdleStatus.WRITER_IDLE
in milliseconds.public void setBothIdleTime(int idleTime)
IdleStatus.WRITER_IDLE
in seconds.setBothIdleTime
在接口中 IoSessionConfig
idleTime
- The time to setpublic void setReaderIdleTime(int idleTime)
IdleStatus.READER_IDLE
in seconds.setReaderIdleTime
在接口中 IoSessionConfig
idleTime
- The time to setpublic void setWriterIdleTime(int idleTime)
IdleStatus.WRITER_IDLE
in seconds.setWriterIdleTime
在接口中 IoSessionConfig
idleTime
- The time to setpublic int getWriteTimeout()
getWriteTimeout
在接口中 IoSessionConfig
public long getWriteTimeoutInMillis()
getWriteTimeoutInMillis
在接口中 IoSessionConfig
public void setWriteTimeout(int writeTimeout)
setWriteTimeout
在接口中 IoSessionConfig
writeTimeout
- The timeout to setpublic boolean isUseReadOperation()
isUseReadOperation
在接口中 IoSessionConfig
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.public 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.setUseReadOperation
在接口中 IoSessionConfig
useReadOperation
- true if the read operation is enabled, false otherwisepublic int getThroughputCalculationInterval()
getThroughputCalculationInterval
在接口中 IoSessionConfig
public void setThroughputCalculationInterval(int throughputCalculationInterval)
setThroughputCalculationInterval
在接口中 IoSessionConfig
throughputCalculationInterval
- The intervalpublic long getThroughputCalculationIntervalInMillis()
getThroughputCalculationIntervalInMillis
在接口中 IoSessionConfig