Package io.netty.channel.epoll
Class EpollSocketChannelConfig
- java.lang.Object
-
- io.netty.channel.DefaultChannelConfig
-
- io.netty.channel.epoll.EpollChannelConfig
-
- io.netty.channel.epoll.EpollSocketChannelConfig
-
- All Implemented Interfaces:
io.netty.channel.ChannelConfig,io.netty.channel.socket.DuplexChannelConfig,io.netty.channel.socket.SocketChannelConfig
public final class EpollSocketChannelConfig extends EpollChannelConfig implements io.netty.channel.socket.SocketChannelConfig
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <T> TgetOption(io.netty.channel.ChannelOption<T> option)Map<io.netty.channel.ChannelOption<?>,Object>getOptions()intgetReceiveBufferSize()intgetSendBufferSize()intgetSoBusyPoll()Get theSO_BUSY_POLLoption on the socket.intgetSoLinger()intgetTcpKeepCnt()Get theTCP_KEEPCNToption on the socket.intgetTcpKeepIdle()Get theTCP_KEEPIDLEoption on the socket.intgetTcpKeepIntvl()Get theTCP_KEEPINTVLoption on the socket.longgetTcpNotSentLowAt()Get theTCP_NOTSENT_LOWAToption on the socket.intgetTcpUserTimeout()Get theTCP_USER_TIMEOUToption on the socket.intgetTrafficClass()booleanisAllowHalfClosure()booleanisIpBindAddressNoPort()Returnstrueif the IP_BIND_ADDRESS_NO_PORT option is set.booleanisIpTransparent()booleanisKeepAlive()booleanisReuseAddress()booleanisTcpCork()Get theTCP_CORKoption on the socket.booleanisTcpFastOpenConnect()Returnstrueif TCP fast open is enabled,falseotherwise.booleanisTcpNoDelay()booleanisTcpQuickAck()EpollSocketChannelConfigsetAllocator(io.netty.buffer.ByteBufAllocator allocator)EpollSocketChannelConfigsetAllowHalfClosure(boolean allowHalfClosure)EpollSocketChannelConfigsetAutoClose(boolean autoClose)EpollSocketChannelConfigsetAutoRead(boolean autoRead)EpollSocketChannelConfigsetConnectTimeoutMillis(int connectTimeoutMillis)EpollSocketChannelConfigsetEpollMode(EpollMode mode)Set theEpollModeused.EpollSocketChannelConfigsetIpBindAddressNoPort(boolean ipBindAddressNoPort)Set the IP_BIND_ADDRESS_NO_PORT option on the underlying Channel.EpollSocketChannelConfigsetIpTransparent(boolean transparent)EpollSocketChannelConfigsetKeepAlive(boolean keepAlive)EpollSocketChannelConfigsetMaxMessagesPerRead(int maxMessagesPerRead)Deprecated.EpollSocketChannelConfigsetMessageSizeEstimator(io.netty.channel.MessageSizeEstimator estimator)<T> booleansetOption(io.netty.channel.ChannelOption<T> option, T value)EpollSocketChannelConfigsetPerformancePreferences(int connectionTime, int latency, int bandwidth)EpollSocketChannelConfigsetReceiveBufferSize(int receiveBufferSize)EpollSocketChannelConfigsetRecvByteBufAllocator(io.netty.channel.RecvByteBufAllocator allocator)EpollSocketChannelConfigsetReuseAddress(boolean reuseAddress)EpollSocketChannelConfigsetSendBufferSize(int sendBufferSize)EpollSocketChannelConfigsetSoBusyPoll(int loopMicros)Set theSO_BUSY_POLLoption on the socket.EpollSocketChannelConfigsetSoLinger(int soLinger)EpollSocketChannelConfigsetTcpCork(boolean tcpCork)Set theTCP_CORKoption on the socket.EpollSocketChannelConfigsetTcpFastOpenConnect(boolean fastOpenConnect)Enables client TCP fast open.EpollSocketChannelConfigsetTcpKeepCnt(int probes)Set theTCP_KEEPCNToption on the socket.EpollSocketChannelConfigsetTcpKeepCntl(int probes)Deprecated.EpollSocketChannelConfigsetTcpKeepIdle(int seconds)Set theTCP_KEEPIDLEoption on the socket.EpollSocketChannelConfigsetTcpKeepIntvl(int seconds)Set theTCP_KEEPINTVLoption on the socket.EpollSocketChannelConfigsetTcpMd5Sig(Map<InetAddress,byte[]> keys)Set theTCP_MD5SIGoption on the socket.EpollSocketChannelConfigsetTcpNoDelay(boolean tcpNoDelay)EpollSocketChannelConfigsetTcpNotSentLowAt(long tcpNotSentLowAt)Set theTCP_NOTSENT_LOWAToption on the socket.EpollSocketChannelConfigsetTcpQuickAck(boolean quickAck)Set theTCP_QUICKACKoption on the socket.EpollSocketChannelConfigsetTcpUserTimeout(int milliseconds)Set theTCP_USER_TIMEOUToption on the socket.EpollSocketChannelConfigsetTrafficClass(int trafficClass)EpollSocketChannelConfigsetWriteBufferHighWaterMark(int writeBufferHighWaterMark)Deprecated.EpollSocketChannelConfigsetWriteBufferLowWaterMark(int writeBufferLowWaterMark)Deprecated.EpollSocketChannelConfigsetWriteBufferWaterMark(io.netty.channel.WriteBufferWaterMark writeBufferWaterMark)EpollSocketChannelConfigsetWriteSpinCount(int writeSpinCount)-
Methods inherited from class io.netty.channel.epoll.EpollChannelConfig
autoReadCleared, getEpollMode, getMaxBytesPerGatheringWrite, setMaxBytesPerGatheringWrite, socket
-
Methods inherited from class io.netty.channel.DefaultChannelConfig
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMaxMessagesPerWrite, getMessageSizeEstimator, getOptions, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setMaxMessagesPerWrite, setOptions, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty.channel.ChannelConfig
getAllocator, getConnectTimeoutMillis, getMaxMessagesPerRead, getMessageSizeEstimator, getRecvByteBufAllocator, getWriteBufferHighWaterMark, getWriteBufferLowWaterMark, getWriteBufferWaterMark, getWriteSpinCount, isAutoClose, isAutoRead, setOptions
-
-
-
-
Method Detail
-
getOptions
public Map<io.netty.channel.ChannelOption<?>,Object> getOptions()
- Specified by:
getOptionsin interfaceio.netty.channel.ChannelConfig- Overrides:
getOptionsin classEpollChannelConfig
-
getOption
public <T> T getOption(io.netty.channel.ChannelOption<T> option)
- Specified by:
getOptionin interfaceio.netty.channel.ChannelConfig- Overrides:
getOptionin classEpollChannelConfig
-
setOption
public <T> boolean setOption(io.netty.channel.ChannelOption<T> option, T value)- Specified by:
setOptionin interfaceio.netty.channel.ChannelConfig- Overrides:
setOptionin classEpollChannelConfig
-
getReceiveBufferSize
public int getReceiveBufferSize()
- Specified by:
getReceiveBufferSizein interfaceio.netty.channel.socket.SocketChannelConfig
-
getSendBufferSize
public int getSendBufferSize()
- Specified by:
getSendBufferSizein interfaceio.netty.channel.socket.SocketChannelConfig
-
getSoLinger
public int getSoLinger()
- Specified by:
getSoLingerin interfaceio.netty.channel.socket.SocketChannelConfig
-
getTrafficClass
public int getTrafficClass()
- Specified by:
getTrafficClassin interfaceio.netty.channel.socket.SocketChannelConfig
-
isKeepAlive
public boolean isKeepAlive()
- Specified by:
isKeepAlivein interfaceio.netty.channel.socket.SocketChannelConfig
-
isReuseAddress
public boolean isReuseAddress()
- Specified by:
isReuseAddressin interfaceio.netty.channel.socket.SocketChannelConfig
-
isTcpNoDelay
public boolean isTcpNoDelay()
- Specified by:
isTcpNoDelayin interfaceio.netty.channel.socket.SocketChannelConfig
-
isTcpCork
public boolean isTcpCork()
Get theTCP_CORKoption on the socket. Seeman 7 tcpfor more details.
-
getSoBusyPoll
public int getSoBusyPoll()
Get theSO_BUSY_POLLoption on the socket. Seeman 7 tcpfor more details.
-
getTcpNotSentLowAt
public long getTcpNotSentLowAt()
Get theTCP_NOTSENT_LOWAToption on the socket. Seeman 7 tcpfor more details.- Returns:
- value is a uint32_t
-
getTcpKeepIdle
public int getTcpKeepIdle()
Get theTCP_KEEPIDLEoption on the socket. Seeman 7 tcpfor more details.
-
getTcpKeepIntvl
public int getTcpKeepIntvl()
Get theTCP_KEEPINTVLoption on the socket. Seeman 7 tcpfor more details.
-
getTcpKeepCnt
public int getTcpKeepCnt()
Get theTCP_KEEPCNToption on the socket. Seeman 7 tcpfor more details.
-
getTcpUserTimeout
public int getTcpUserTimeout()
Get theTCP_USER_TIMEOUToption on the socket. Seeman 7 tcpfor more details.
-
setKeepAlive
public EpollSocketChannelConfig setKeepAlive(boolean keepAlive)
- Specified by:
setKeepAlivein interfaceio.netty.channel.socket.SocketChannelConfig
-
setPerformancePreferences
public EpollSocketChannelConfig setPerformancePreferences(int connectionTime, int latency, int bandwidth)
- Specified by:
setPerformancePreferencesin interfaceio.netty.channel.socket.SocketChannelConfig
-
setReceiveBufferSize
public EpollSocketChannelConfig setReceiveBufferSize(int receiveBufferSize)
- Specified by:
setReceiveBufferSizein interfaceio.netty.channel.socket.SocketChannelConfig
-
setReuseAddress
public EpollSocketChannelConfig setReuseAddress(boolean reuseAddress)
- Specified by:
setReuseAddressin interfaceio.netty.channel.socket.SocketChannelConfig
-
setSendBufferSize
public EpollSocketChannelConfig setSendBufferSize(int sendBufferSize)
- Specified by:
setSendBufferSizein interfaceio.netty.channel.socket.SocketChannelConfig
-
setSoLinger
public EpollSocketChannelConfig setSoLinger(int soLinger)
- Specified by:
setSoLingerin interfaceio.netty.channel.socket.SocketChannelConfig
-
setTcpNoDelay
public EpollSocketChannelConfig setTcpNoDelay(boolean tcpNoDelay)
- Specified by:
setTcpNoDelayin interfaceio.netty.channel.socket.SocketChannelConfig
-
setTcpCork
public EpollSocketChannelConfig setTcpCork(boolean tcpCork)
Set theTCP_CORKoption on the socket. Seeman 7 tcpfor more details.
-
setSoBusyPoll
public EpollSocketChannelConfig setSoBusyPoll(int loopMicros)
Set theSO_BUSY_POLLoption on the socket. Seeman 7 tcpfor more details.
-
setTcpNotSentLowAt
public EpollSocketChannelConfig setTcpNotSentLowAt(long tcpNotSentLowAt)
Set theTCP_NOTSENT_LOWAToption on the socket. Seeman 7 tcpfor more details.- Parameters:
tcpNotSentLowAt- is a uint32_t
-
setTrafficClass
public EpollSocketChannelConfig setTrafficClass(int trafficClass)
- Specified by:
setTrafficClassin interfaceio.netty.channel.socket.SocketChannelConfig
-
setTcpKeepIdle
public EpollSocketChannelConfig setTcpKeepIdle(int seconds)
Set theTCP_KEEPIDLEoption on the socket. Seeman 7 tcpfor more details.
-
setTcpKeepIntvl
public EpollSocketChannelConfig setTcpKeepIntvl(int seconds)
Set theTCP_KEEPINTVLoption on the socket. Seeman 7 tcpfor more details.
-
setTcpKeepCntl
@Deprecated public EpollSocketChannelConfig setTcpKeepCntl(int probes)
Deprecated.
-
setTcpKeepCnt
public EpollSocketChannelConfig setTcpKeepCnt(int probes)
Set theTCP_KEEPCNToption on the socket. Seeman 7 tcpfor more details.
-
setTcpUserTimeout
public EpollSocketChannelConfig setTcpUserTimeout(int milliseconds)
Set theTCP_USER_TIMEOUToption on the socket. Seeman 7 tcpfor more details.
-
isIpBindAddressNoPort
public boolean isIpBindAddressNoPort()
Returnstrueif the IP_BIND_ADDRESS_NO_PORT option is set.
-
setIpBindAddressNoPort
public EpollSocketChannelConfig setIpBindAddressNoPort(boolean ipBindAddressNoPort)
Set the IP_BIND_ADDRESS_NO_PORT option on the underlying Channel. Be aware this method needs be called beforeChannel.bind(java.net.SocketAddress)to have any affect.
-
isIpTransparent
public boolean isIpTransparent()
-
setIpTransparent
public EpollSocketChannelConfig setIpTransparent(boolean transparent)
-
setTcpMd5Sig
public EpollSocketChannelConfig setTcpMd5Sig(Map<InetAddress,byte[]> keys)
Set theTCP_MD5SIGoption on the socket. Seelinux/tcp.hfor 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.
-
setTcpQuickAck
public EpollSocketChannelConfig setTcpQuickAck(boolean quickAck)
Set theTCP_QUICKACKoption on the socket. See TCP_QUICKACK for more details.
-
isTcpQuickAck
public boolean isTcpQuickAck()
-
setTcpFastOpenConnect
public EpollSocketChannelConfig setTcpFastOpenConnect(boolean fastOpenConnect)
Enables client TCP fast open.TCP_FASTOPEN_CONNECTnormally requires Linux kernel 4.11 or later, so instead we use the traditional fast open client socket mechanics that work with kernel 3.6 and later. See this LWN article for more info.
-
isTcpFastOpenConnect
public boolean isTcpFastOpenConnect()
Returnstrueif TCP fast open is enabled,falseotherwise.
-
isAllowHalfClosure
public boolean isAllowHalfClosure()
- Specified by:
isAllowHalfClosurein interfaceio.netty.channel.socket.DuplexChannelConfig
-
setAllowHalfClosure
public EpollSocketChannelConfig setAllowHalfClosure(boolean allowHalfClosure)
- Specified by:
setAllowHalfClosurein interfaceio.netty.channel.socket.DuplexChannelConfig- Specified by:
setAllowHalfClosurein interfaceio.netty.channel.socket.SocketChannelConfig
-
setConnectTimeoutMillis
public EpollSocketChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis)
- Specified by:
setConnectTimeoutMillisin interfaceio.netty.channel.ChannelConfig- Specified by:
setConnectTimeoutMillisin interfaceio.netty.channel.socket.SocketChannelConfig- Overrides:
setConnectTimeoutMillisin classEpollChannelConfig
-
setMaxMessagesPerRead
@Deprecated public EpollSocketChannelConfig setMaxMessagesPerRead(int maxMessagesPerRead)
Deprecated.- Specified by:
setMaxMessagesPerReadin interfaceio.netty.channel.ChannelConfig- Specified by:
setMaxMessagesPerReadin interfaceio.netty.channel.socket.DuplexChannelConfig- Specified by:
setMaxMessagesPerReadin interfaceio.netty.channel.socket.SocketChannelConfig- Overrides:
setMaxMessagesPerReadin classEpollChannelConfig
-
setWriteSpinCount
public EpollSocketChannelConfig setWriteSpinCount(int writeSpinCount)
- Specified by:
setWriteSpinCountin interfaceio.netty.channel.ChannelConfig- Specified by:
setWriteSpinCountin interfaceio.netty.channel.socket.DuplexChannelConfig- Specified by:
setWriteSpinCountin interfaceio.netty.channel.socket.SocketChannelConfig- Overrides:
setWriteSpinCountin classEpollChannelConfig
-
setAllocator
public EpollSocketChannelConfig setAllocator(io.netty.buffer.ByteBufAllocator allocator)
- Specified by:
setAllocatorin interfaceio.netty.channel.ChannelConfig- Specified by:
setAllocatorin interfaceio.netty.channel.socket.DuplexChannelConfig- Specified by:
setAllocatorin interfaceio.netty.channel.socket.SocketChannelConfig- Overrides:
setAllocatorin classEpollChannelConfig
-
setRecvByteBufAllocator
public EpollSocketChannelConfig setRecvByteBufAllocator(io.netty.channel.RecvByteBufAllocator allocator)
- Specified by:
setRecvByteBufAllocatorin interfaceio.netty.channel.ChannelConfig- Specified by:
setRecvByteBufAllocatorin interfaceio.netty.channel.socket.DuplexChannelConfig- Specified by:
setRecvByteBufAllocatorin interfaceio.netty.channel.socket.SocketChannelConfig- Overrides:
setRecvByteBufAllocatorin classEpollChannelConfig
-
setAutoRead
public EpollSocketChannelConfig setAutoRead(boolean autoRead)
- Specified by:
setAutoReadin interfaceio.netty.channel.ChannelConfig- Specified by:
setAutoReadin interfaceio.netty.channel.socket.DuplexChannelConfig- Specified by:
setAutoReadin interfaceio.netty.channel.socket.SocketChannelConfig- Overrides:
setAutoReadin classEpollChannelConfig
-
setAutoClose
public EpollSocketChannelConfig setAutoClose(boolean autoClose)
- Specified by:
setAutoClosein interfaceio.netty.channel.ChannelConfig- Specified by:
setAutoClosein interfaceio.netty.channel.socket.DuplexChannelConfig- Specified by:
setAutoClosein interfaceio.netty.channel.socket.SocketChannelConfig- Overrides:
setAutoClosein classio.netty.channel.DefaultChannelConfig
-
setWriteBufferHighWaterMark
@Deprecated public EpollSocketChannelConfig setWriteBufferHighWaterMark(int writeBufferHighWaterMark)
Deprecated.- Specified by:
setWriteBufferHighWaterMarkin interfaceio.netty.channel.ChannelConfig- Overrides:
setWriteBufferHighWaterMarkin classEpollChannelConfig
-
setWriteBufferLowWaterMark
@Deprecated public EpollSocketChannelConfig setWriteBufferLowWaterMark(int writeBufferLowWaterMark)
Deprecated.- Specified by:
setWriteBufferLowWaterMarkin interfaceio.netty.channel.ChannelConfig- Overrides:
setWriteBufferLowWaterMarkin classEpollChannelConfig
-
setWriteBufferWaterMark
public EpollSocketChannelConfig setWriteBufferWaterMark(io.netty.channel.WriteBufferWaterMark writeBufferWaterMark)
- Specified by:
setWriteBufferWaterMarkin interfaceio.netty.channel.ChannelConfig- Specified by:
setWriteBufferWaterMarkin interfaceio.netty.channel.socket.DuplexChannelConfig- Specified by:
setWriteBufferWaterMarkin interfaceio.netty.channel.socket.SocketChannelConfig- Overrides:
setWriteBufferWaterMarkin classEpollChannelConfig
-
setMessageSizeEstimator
public EpollSocketChannelConfig setMessageSizeEstimator(io.netty.channel.MessageSizeEstimator estimator)
- Specified by:
setMessageSizeEstimatorin interfaceio.netty.channel.ChannelConfig- Specified by:
setMessageSizeEstimatorin interfaceio.netty.channel.socket.DuplexChannelConfig- Specified by:
setMessageSizeEstimatorin interfaceio.netty.channel.socket.SocketChannelConfig- Overrides:
setMessageSizeEstimatorin classEpollChannelConfig
-
setEpollMode
public EpollSocketChannelConfig setEpollMode(EpollMode mode)
Description copied from class:EpollChannelConfigSet theEpollModeused. Default isEpollMode.EDGE_TRIGGERED. If you want to useDefaultChannelConfig.isAutoRead()falseorDefaultChannelConfig.getMaxMessagesPerRead()and have an accurate behaviour you should useEpollMode.LEVEL_TRIGGERED. Be aware this config setting can only be adjusted before the channel was registered.- Overrides:
setEpollModein classEpollChannelConfig
-
-