Class NioSocketSession.SessionConfigImpl
java.lang.Object
org.apache.mina.core.session.AbstractIoSessionConfig
org.apache.mina.transport.socket.AbstractSocketSessionConfig
org.apache.mina.transport.socket.nio.NioSocketSession.SessionConfigImpl
- All Implemented Interfaces:
IoSessionConfig, SocketSessionConfig
- Enclosing class:
NioSocketSession
A private class storing a copy of the IoService configuration when the IoSession
is created. That allows the session to have its own configuration setting, over
the IoService default one.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintPlease note that enablingSO_LINGERin Java NIO can result in platform-dependent behavior and unexpected blocking of I/O thread.intbooleanbooleanbooleanbooleanvoidsetKeepAlive(boolean on) voidsetOobInline(boolean on) voidsetReceiveBufferSize(int size) voidsetReuseAddress(boolean on) voidsetSendBufferSize(int size) voidsetSoLinger(int linger) Please note that enablingSO_LINGERin Java NIO can result in platform-dependent behavior and unexpected blocking of I/O thread.voidsetTcpNoDelay(boolean on) voidsetTrafficClass(int tc) Methods inherited from class AbstractSocketSessionConfig
isKeepAliveChanged, isOobInlineChanged, isReceiveBufferSizeChanged, isReuseAddressChanged, isSendBufferSizeChanged, isSoLingerChanged, isTcpNoDelayChanged, isTrafficClassChanged, setAllMethods inherited from class AbstractIoSessionConfig
getBothIdleTime, getBothIdleTimeInMillis, getIdleTime, getIdleTimeInMillis, getMaxReadBufferSize, getMinReadBufferSize, getReadBufferSize, getReaderIdleTime, getReaderIdleTimeInMillis, getThroughputCalculationInterval, getThroughputCalculationIntervalInMillis, getWriterIdleTime, getWriterIdleTimeInMillis, getWriteTimeout, getWriteTimeoutInMillis, isUseReadOperation, setBothIdleTime, setIdleTime, setMaxReadBufferSize, setMinReadBufferSize, setReadBufferSize, setReaderIdleTime, setThroughputCalculationInterval, setUseReadOperation, setWriterIdleTime, setWriteTimeoutMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IoSessionConfig
getBothIdleTime, getBothIdleTimeInMillis, getIdleTime, getIdleTimeInMillis, getMaxReadBufferSize, getMinReadBufferSize, getReadBufferSize, getReaderIdleTime, getReaderIdleTimeInMillis, getThroughputCalculationInterval, getThroughputCalculationIntervalInMillis, getWriterIdleTime, getWriterIdleTimeInMillis, getWriteTimeout, getWriteTimeoutInMillis, isUseReadOperation, setBothIdleTime, setIdleTime, setMaxReadBufferSize, setMinReadBufferSize, setReadBufferSize, setReaderIdleTime, setThroughputCalculationInterval, setUseReadOperation, setWriterIdleTime, setWriteTimeout
-
Constructor Details
-
SessionConfigImpl
private SessionConfigImpl()
-
-
Method Details
-
isKeepAlive
public boolean isKeepAlive()- Returns:
trueifSO_KEEPALIVEis enabled.- See Also:
-
setKeepAlive
public void setKeepAlive(boolean on) - Parameters:
on- ifSO_KEEPALIVEis to be enabled- See Also:
-
isOobInline
public boolean isOobInline()- Returns:
trueifSO_OOBINLINEis enabled.- See Also:
-
setOobInline
public void setOobInline(boolean on) - Parameters:
on- ifSO_OOBINLINEis to be enabled- See Also:
-
isReuseAddress
public boolean isReuseAddress()- Returns:
trueif SO_REUSEADDR is enabled.- See Also:
-
setReuseAddress
public void setReuseAddress(boolean on) - Parameters:
on- Tells if SO_REUSEADDR is enabled or disabled- See Also:
-
getSoLinger
public int getSoLinger()Please note that enablingSO_LINGERin Java NIO can result in platform-dependent behavior and unexpected blocking of I/O thread.- Returns:
- The value for
SO_LINGER - See Also:
-
setSoLinger
public void setSoLinger(int linger) Please note that enablingSO_LINGERin Java NIO can result in platform-dependent behavior and unexpected blocking of I/O thread.- Parameters:
linger- Please specify a negative value to disableSO_LINGER.- See Also:
-
isTcpNoDelay
public boolean isTcpNoDelay()- Returns:
trueifTCP_NODELAYis enabled.- See Also:
-
setTcpNoDelay
public void setTcpNoDelay(boolean on) - Parameters:
on-trueifTCP_NODELAYis to be enabled- See Also:
-
getTrafficClass
public int getTrafficClass()- Returns:
- the traffic class
- See Also:
-
setTrafficClass
public void setTrafficClass(int tc) - Parameters:
tc- The traffic class to set, one ofIPTOS_LOWCOST(0x02)IPTOS_RELIABILITY(0x04),IPTOS_THROUGHPUT(0x08) orIPTOS_LOWDELAY(0x10)- See Also:
-
getSendBufferSize
public int getSendBufferSize()- Returns:
- the size of the send buffer
- See Also:
-
setSendBufferSize
public void setSendBufferSize(int size) - Parameters:
size- The size of the send buffer- See Also:
-
getReceiveBufferSize
public int getReceiveBufferSize()- Returns:
- the size of the receive buffer
- See Also:
-
setReceiveBufferSize
public void setReceiveBufferSize(int size) - Parameters:
size- The size of the receive buffer- See Also:
-