public final class EpollSocketChannelConfig extends EpollChannelConfig implements io.netty.channel.socket.SocketChannelConfig
Modifier and Type | Method and Description |
---|---|
<T> T |
getOption(io.netty.channel.ChannelOption<T> option) |
Map<io.netty.channel.ChannelOption<?>,Object> |
getOptions() |
int |
getReceiveBufferSize() |
int |
getSendBufferSize() |
int |
getSoBusyPoll()
Get the
SO_BUSY_POLL option on the socket. |
int |
getSoLinger() |
int |
getTcpKeepCnt()
Get the
TCP_KEEPCNT option on the socket. |
int |
getTcpKeepIdle()
Get the
TCP_KEEPIDLE option on the socket. |
int |
getTcpKeepIntvl()
Get the
TCP_KEEPINTVL option on the socket. |
long |
getTcpNotSentLowAt()
Get the
TCP_NOTSENT_LOWAT option on the socket. |
int |
getTcpUserTimeout()
Get the
TCP_USER_TIMEOUT option on the socket. |
int |
getTrafficClass() |
boolean |
isAllowHalfClosure() |
boolean |
isIpTransparent()
|
boolean |
isKeepAlive() |
boolean |
isReuseAddress() |
boolean |
isTcpCork()
Get the
TCP_CORK option on the socket. |
boolean |
isTcpFastOpenConnect()
Returns
true if TCP_FASTOPEN_CONNECT is enabled, false otherwise. |
boolean |
isTcpNoDelay() |
boolean |
isTcpQuickAck()
|
EpollSocketChannelConfig |
setAllocator(io.netty.buffer.ByteBufAllocator allocator) |
EpollSocketChannelConfig |
setAllowHalfClosure(boolean allowHalfClosure) |
EpollSocketChannelConfig |
setAutoClose(boolean autoClose) |
EpollSocketChannelConfig |
setAutoRead(boolean autoRead) |
EpollSocketChannelConfig |
setConnectTimeoutMillis(int connectTimeoutMillis) |
EpollSocketChannelConfig |
setEpollMode(EpollMode mode)
Set the
EpollMode used. |
EpollSocketChannelConfig |
setIpTransparent(boolean transparent)
|
EpollSocketChannelConfig |
setKeepAlive(boolean keepAlive) |
EpollSocketChannelConfig |
setMaxMessagesPerRead(int maxMessagesPerRead)
Deprecated.
|
EpollSocketChannelConfig |
setMessageSizeEstimator(io.netty.channel.MessageSizeEstimator estimator) |
<T> boolean |
setOption(io.netty.channel.ChannelOption<T> option,
T value) |
EpollSocketChannelConfig |
setPerformancePreferences(int connectionTime,
int latency,
int bandwidth) |
EpollSocketChannelConfig |
setReceiveBufferSize(int receiveBufferSize) |
EpollSocketChannelConfig |
setRecvByteBufAllocator(io.netty.channel.RecvByteBufAllocator allocator) |
EpollSocketChannelConfig |
setReuseAddress(boolean reuseAddress) |
EpollSocketChannelConfig |
setSendBufferSize(int sendBufferSize) |
EpollSocketChannelConfig |
setSoBusyPoll(int loopMicros)
Set the
SO_BUSY_POLL option on the socket. |
EpollSocketChannelConfig |
setSoLinger(int soLinger) |
EpollSocketChannelConfig |
setTcpCork(boolean tcpCork)
Set the
TCP_CORK option on the socket. |
EpollSocketChannelConfig |
setTcpFastOpenConnect(boolean fastOpenConnect)
Set the
TCP_FASTOPEN_CONNECT option on the socket. |
EpollSocketChannelConfig |
setTcpKeepCnt(int probes)
Set the
TCP_KEEPCNT option on the socket. |
EpollSocketChannelConfig |
setTcpKeepCntl(int probes)
Deprecated.
|
EpollSocketChannelConfig |
setTcpKeepIdle(int seconds)
Set the
TCP_KEEPIDLE option on the socket. |
EpollSocketChannelConfig |
setTcpKeepIntvl(int seconds)
Set the
TCP_KEEPINTVL option on the socket. |
EpollSocketChannelConfig |
setTcpMd5Sig(Map<InetAddress,byte[]> keys)
Set the
TCP_MD5SIG option on the socket. |
EpollSocketChannelConfig |
setTcpNoDelay(boolean tcpNoDelay) |
EpollSocketChannelConfig |
setTcpNotSentLowAt(long tcpNotSentLowAt)
Set the
TCP_NOTSENT_LOWAT option on the socket. |
EpollSocketChannelConfig |
setTcpQuickAck(boolean quickAck)
Set the
TCP_QUICKACK option on the socket. |
EpollSocketChannelConfig |
setTcpUserTimeout(int milliseconds)
Set the
TCP_USER_TIMEOUT option on the socket. |
EpollSocketChannelConfig |
setTrafficClass(int trafficClass) |
EpollSocketChannelConfig |
setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
Deprecated.
|
EpollSocketChannelConfig |
setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
Deprecated.
|
EpollSocketChannelConfig |
setWriteBufferWaterMark(io.netty.channel.WriteBufferWaterMark writeBufferWaterMark) |
EpollSocketChannelConfig |
setWriteSpinCount(int writeSpinCount) |
autoReadCleared, getEpollMode
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMessageSizeEstimator, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setOptions, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMessageSizeEstimator, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setOptions
public Map<io.netty.channel.ChannelOption<?>,Object> getOptions()
getOptions
in interface io.netty.channel.ChannelConfig
getOptions
in class EpollChannelConfig
public <T> T getOption(io.netty.channel.ChannelOption<T> option)
getOption
in interface io.netty.channel.ChannelConfig
getOption
in class EpollChannelConfig
public <T> boolean setOption(io.netty.channel.ChannelOption<T> option, T value)
setOption
in interface io.netty.channel.ChannelConfig
setOption
in class EpollChannelConfig
public int getReceiveBufferSize()
getReceiveBufferSize
in interface io.netty.channel.socket.SocketChannelConfig
public int getSendBufferSize()
getSendBufferSize
in interface io.netty.channel.socket.SocketChannelConfig
public int getSoLinger()
getSoLinger
in interface io.netty.channel.socket.SocketChannelConfig
public int getTrafficClass()
getTrafficClass
in interface io.netty.channel.socket.SocketChannelConfig
public boolean isKeepAlive()
isKeepAlive
in interface io.netty.channel.socket.SocketChannelConfig
public boolean isReuseAddress()
isReuseAddress
in interface io.netty.channel.socket.SocketChannelConfig
public boolean isTcpNoDelay()
isTcpNoDelay
in interface io.netty.channel.socket.SocketChannelConfig
public boolean isTcpCork()
TCP_CORK
option on the socket. See man 7 tcp
for more details.public int getSoBusyPoll()
SO_BUSY_POLL
option on the socket. See man 7 tcp
for more details.public long getTcpNotSentLowAt()
TCP_NOTSENT_LOWAT
option on the socket. See man 7 tcp
for more details.public int getTcpKeepIdle()
TCP_KEEPIDLE
option on the socket. See man 7 tcp
for more details.public int getTcpKeepIntvl()
TCP_KEEPINTVL
option on the socket. See man 7 tcp
for more details.public int getTcpKeepCnt()
TCP_KEEPCNT
option on the socket. See man 7 tcp
for more details.public int getTcpUserTimeout()
TCP_USER_TIMEOUT
option on the socket. See man 7 tcp
for more details.public EpollSocketChannelConfig setKeepAlive(boolean keepAlive)
setKeepAlive
in interface io.netty.channel.socket.SocketChannelConfig
public EpollSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth)
setPerformancePreferences
in interface io.netty.channel.socket.SocketChannelConfig
public EpollSocketChannelConfig setReceiveBufferSize(int receiveBufferSize)
setReceiveBufferSize
in interface io.netty.channel.socket.SocketChannelConfig
public EpollSocketChannelConfig setReuseAddress(boolean reuseAddress)
setReuseAddress
in interface io.netty.channel.socket.SocketChannelConfig
public EpollSocketChannelConfig setSendBufferSize(int sendBufferSize)
setSendBufferSize
in interface io.netty.channel.socket.SocketChannelConfig
public EpollSocketChannelConfig setSoLinger(int soLinger)
setSoLinger
in interface io.netty.channel.socket.SocketChannelConfig
public EpollSocketChannelConfig setTcpNoDelay(boolean tcpNoDelay)
setTcpNoDelay
in interface io.netty.channel.socket.SocketChannelConfig
public EpollSocketChannelConfig setTcpCork(boolean tcpCork)
TCP_CORK
option on the socket. See man 7 tcp
for more details.public EpollSocketChannelConfig setSoBusyPoll(int loopMicros)
SO_BUSY_POLL
option on the socket. See man 7 tcp
for more details.public EpollSocketChannelConfig setTcpNotSentLowAt(long tcpNotSentLowAt)
TCP_NOTSENT_LOWAT
option on the socket. See man 7 tcp
for more details.tcpNotSentLowAt
- is a uint32_tpublic EpollSocketChannelConfig setTrafficClass(int trafficClass)
setTrafficClass
in interface io.netty.channel.socket.SocketChannelConfig
public EpollSocketChannelConfig setTcpKeepIdle(int seconds)
TCP_KEEPIDLE
option on the socket. See man 7 tcp
for more details.public EpollSocketChannelConfig setTcpKeepIntvl(int seconds)
TCP_KEEPINTVL
option on the socket. See man 7 tcp
for more details.@Deprecated public EpollSocketChannelConfig setTcpKeepCntl(int probes)
setTcpKeepCnt(int)
public EpollSocketChannelConfig setTcpKeepCnt(int probes)
TCP_KEEPCNT
option on the socket. See man 7 tcp
for more details.public EpollSocketChannelConfig setTcpUserTimeout(int milliseconds)
TCP_USER_TIMEOUT
option on the socket. See man 7 tcp
for more details.public boolean isIpTransparent()
public EpollSocketChannelConfig setIpTransparent(boolean transparent)
public EpollSocketChannelConfig setTcpMd5Sig(Map<InetAddress,byte[]> keys)
TCP_MD5SIG
option on the socket. See linux/tcp.h
for more details.
Keys can only be set on, not read to prevent a potential leak, as they are confidential.
Allowing them being read would mean anyone with access to the channel could get them.public EpollSocketChannelConfig setTcpQuickAck(boolean quickAck)
TCP_QUICKACK
option on the socket. See TCP_QUICKACK
for more details.public boolean isTcpQuickAck()
public EpollSocketChannelConfig setTcpFastOpenConnect(boolean fastOpenConnect)
TCP_FASTOPEN_CONNECT
option on the socket. Requires Linux kernel 4.11 or later.
See
this commit
for more details.public boolean isTcpFastOpenConnect()
true
if TCP_FASTOPEN_CONNECT
is enabled, false
otherwise.public boolean isAllowHalfClosure()
isAllowHalfClosure
in interface io.netty.channel.socket.SocketChannelConfig
public EpollSocketChannelConfig setAllowHalfClosure(boolean allowHalfClosure)
setAllowHalfClosure
in interface io.netty.channel.socket.SocketChannelConfig
public EpollSocketChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis)
setConnectTimeoutMillis
in interface io.netty.channel.ChannelConfig
setConnectTimeoutMillis
in interface io.netty.channel.socket.SocketChannelConfig
setConnectTimeoutMillis
in class EpollChannelConfig
@Deprecated public EpollSocketChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)
setMaxMessagesPerRead
in interface io.netty.channel.ChannelConfig
setMaxMessagesPerRead
in interface io.netty.channel.socket.SocketChannelConfig
setMaxMessagesPerRead
in class EpollChannelConfig
public EpollSocketChannelConfig setWriteSpinCount(int writeSpinCount)
setWriteSpinCount
in interface io.netty.channel.ChannelConfig
setWriteSpinCount
in interface io.netty.channel.socket.SocketChannelConfig
setWriteSpinCount
in class EpollChannelConfig
public EpollSocketChannelConfig setAllocator(io.netty.buffer.ByteBufAllocator allocator)
setAllocator
in interface io.netty.channel.ChannelConfig
setAllocator
in interface io.netty.channel.socket.SocketChannelConfig
setAllocator
in class EpollChannelConfig
public EpollSocketChannelConfig setRecvByteBufAllocator(io.netty.channel.RecvByteBufAllocator allocator)
setRecvByteBufAllocator
in interface io.netty.channel.ChannelConfig
setRecvByteBufAllocator
in interface io.netty.channel.socket.SocketChannelConfig
setRecvByteBufAllocator
in class EpollChannelConfig
public EpollSocketChannelConfig setAutoRead(boolean autoRead)
setAutoRead
in interface io.netty.channel.ChannelConfig
setAutoRead
in interface io.netty.channel.socket.SocketChannelConfig
setAutoRead
in class EpollChannelConfig
public EpollSocketChannelConfig setAutoClose(boolean autoClose)
setAutoClose
in interface io.netty.channel.ChannelConfig
setAutoClose
in interface io.netty.channel.socket.SocketChannelConfig
setAutoClose
in class io.netty.channel.DefaultChannelConfig
@Deprecated public EpollSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
setWriteBufferHighWaterMark
in interface io.netty.channel.ChannelConfig
setWriteBufferHighWaterMark
in class EpollChannelConfig
@Deprecated public EpollSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
setWriteBufferLowWaterMark
in interface io.netty.channel.ChannelConfig
setWriteBufferLowWaterMark
in class EpollChannelConfig
public EpollSocketChannelConfig setWriteBufferWaterMark(io.netty.channel.WriteBufferWaterMark writeBufferWaterMark)
setWriteBufferWaterMark
in interface io.netty.channel.ChannelConfig
setWriteBufferWaterMark
in interface io.netty.channel.socket.SocketChannelConfig
setWriteBufferWaterMark
in class EpollChannelConfig
public EpollSocketChannelConfig setMessageSizeEstimator(io.netty.channel.MessageSizeEstimator estimator)
setMessageSizeEstimator
in interface io.netty.channel.ChannelConfig
setMessageSizeEstimator
in interface io.netty.channel.socket.SocketChannelConfig
setMessageSizeEstimator
in class EpollChannelConfig
public EpollSocketChannelConfig setEpollMode(EpollMode mode)
EpollChannelConfig
EpollMode
used. Default is
EpollMode.EDGE_TRIGGERED
. If you want to use DefaultChannelConfig.isAutoRead()
false
or
DefaultChannelConfig.getMaxMessagesPerRead()
and have an accurate behaviour you should use
EpollMode.LEVEL_TRIGGERED
.
Be aware this config setting can only be adjusted before the channel was registered.setEpollMode
in class EpollChannelConfig
Copyright © 2008–2019 The Netty Project. All rights reserved.