Class 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 Detail

      • getOptions

        public Map<io.netty.channel.ChannelOption<?>,​Object> getOptions()
        Specified by:
        getOptions in interface io.netty.channel.ChannelConfig
        Overrides:
        getOptions in class EpollChannelConfig
      • getOption

        public <T> T getOption​(io.netty.channel.ChannelOption<T> option)
        Specified by:
        getOption in interface io.netty.channel.ChannelConfig
        Overrides:
        getOption in class EpollChannelConfig
      • setOption

        public <T> boolean setOption​(io.netty.channel.ChannelOption<T> option,
                                     T value)
        Specified by:
        setOption in interface io.netty.channel.ChannelConfig
        Overrides:
        setOption in class EpollChannelConfig
      • getReceiveBufferSize

        public int getReceiveBufferSize()
        Specified by:
        getReceiveBufferSize in interface io.netty.channel.socket.SocketChannelConfig
      • getSendBufferSize

        public int getSendBufferSize()
        Specified by:
        getSendBufferSize in interface io.netty.channel.socket.SocketChannelConfig
      • getSoLinger

        public int getSoLinger()
        Specified by:
        getSoLinger in interface io.netty.channel.socket.SocketChannelConfig
      • getTrafficClass

        public int getTrafficClass()
        Specified by:
        getTrafficClass in interface io.netty.channel.socket.SocketChannelConfig
      • isKeepAlive

        public boolean isKeepAlive()
        Specified by:
        isKeepAlive in interface io.netty.channel.socket.SocketChannelConfig
      • isReuseAddress

        public boolean isReuseAddress()
        Specified by:
        isReuseAddress in interface io.netty.channel.socket.SocketChannelConfig
      • isTcpNoDelay

        public boolean isTcpNoDelay()
        Specified by:
        isTcpNoDelay in interface io.netty.channel.socket.SocketChannelConfig
      • isTcpCork

        public boolean isTcpCork()
        Get the TCP_CORK option on the socket. See man 7 tcp for more details.
      • getSoBusyPoll

        public int getSoBusyPoll()
        Get the SO_BUSY_POLL option on the socket. See man 7 tcp for more details.
      • getTcpNotSentLowAt

        public long getTcpNotSentLowAt()
        Get the TCP_NOTSENT_LOWAT option on the socket. See man 7 tcp for more details.
        Returns:
        value is a uint32_t
      • getTcpKeepIdle

        public int getTcpKeepIdle()
        Get the TCP_KEEPIDLE option on the socket. See man 7 tcp for more details.
      • getTcpKeepIntvl

        public int getTcpKeepIntvl()
        Get the TCP_KEEPINTVL option on the socket. See man 7 tcp for more details.
      • getTcpKeepCnt

        public int getTcpKeepCnt()
        Get the TCP_KEEPCNT option on the socket. See man 7 tcp for more details.
      • getTcpUserTimeout

        public int getTcpUserTimeout()
        Get the TCP_USER_TIMEOUT option on the socket. See man 7 tcp for more details.
      • setKeepAlive

        public EpollSocketChannelConfig setKeepAlive​(boolean keepAlive)
        Specified by:
        setKeepAlive in interface io.netty.channel.socket.SocketChannelConfig
      • setPerformancePreferences

        public EpollSocketChannelConfig setPerformancePreferences​(int connectionTime,
                                                                  int latency,
                                                                  int bandwidth)
        Specified by:
        setPerformancePreferences in interface io.netty.channel.socket.SocketChannelConfig
      • setReceiveBufferSize

        public EpollSocketChannelConfig setReceiveBufferSize​(int receiveBufferSize)
        Specified by:
        setReceiveBufferSize in interface io.netty.channel.socket.SocketChannelConfig
      • setReuseAddress

        public EpollSocketChannelConfig setReuseAddress​(boolean reuseAddress)
        Specified by:
        setReuseAddress in interface io.netty.channel.socket.SocketChannelConfig
      • setSendBufferSize

        public EpollSocketChannelConfig setSendBufferSize​(int sendBufferSize)
        Specified by:
        setSendBufferSize in interface io.netty.channel.socket.SocketChannelConfig
      • setSoLinger

        public EpollSocketChannelConfig setSoLinger​(int soLinger)
        Specified by:
        setSoLinger in interface io.netty.channel.socket.SocketChannelConfig
      • setTcpNoDelay

        public EpollSocketChannelConfig setTcpNoDelay​(boolean tcpNoDelay)
        Specified by:
        setTcpNoDelay in interface io.netty.channel.socket.SocketChannelConfig
      • setTcpCork

        public EpollSocketChannelConfig setTcpCork​(boolean tcpCork)
        Set the TCP_CORK option on the socket. See man 7 tcp for more details.
      • setSoBusyPoll

        public EpollSocketChannelConfig setSoBusyPoll​(int loopMicros)
        Set the SO_BUSY_POLL option on the socket. See man 7 tcp for more details.
      • setTcpNotSentLowAt

        public EpollSocketChannelConfig setTcpNotSentLowAt​(long tcpNotSentLowAt)
        Set the TCP_NOTSENT_LOWAT option on the socket. See man 7 tcp for more details.
        Parameters:
        tcpNotSentLowAt - is a uint32_t
      • setTrafficClass

        public EpollSocketChannelConfig setTrafficClass​(int trafficClass)
        Specified by:
        setTrafficClass in interface io.netty.channel.socket.SocketChannelConfig
      • setTcpKeepIdle

        public EpollSocketChannelConfig setTcpKeepIdle​(int seconds)
        Set the TCP_KEEPIDLE option on the socket. See man 7 tcp for more details.
      • setTcpKeepIntvl

        public EpollSocketChannelConfig setTcpKeepIntvl​(int seconds)
        Set the TCP_KEEPINTVL option on the socket. See man 7 tcp for more details.
      • setTcpKeepCnt

        public EpollSocketChannelConfig setTcpKeepCnt​(int probes)
        Set the TCP_KEEPCNT option on the socket. See man 7 tcp for more details.
      • setTcpUserTimeout

        public EpollSocketChannelConfig setTcpUserTimeout​(int milliseconds)
        Set the TCP_USER_TIMEOUT option on the socket. See man 7 tcp for more details.
      • isIpBindAddressNoPort

        public boolean isIpBindAddressNoPort()
        Returns true if 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 before Channel.bind(java.net.SocketAddress) to have any affect.
      • isIpTransparent

        public boolean isIpTransparent()
        Returns true if IP_TRANSPARENT is enabled, false otherwise.
      • setTcpMd5Sig

        public EpollSocketChannelConfig setTcpMd5Sig​(Map<InetAddress,​byte[]> keys)
        Set the 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.
      • isTcpQuickAck

        public boolean isTcpQuickAck()
        Returns true if TCP_QUICKACK is enabled, false otherwise.
      • setTcpFastOpenConnect

        public EpollSocketChannelConfig setTcpFastOpenConnect​(boolean fastOpenConnect)
        Enables client TCP fast open. TCP_FASTOPEN_CONNECT normally 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()
        Returns true if TCP fast open is enabled, false otherwise.
      • isAllowHalfClosure

        public boolean isAllowHalfClosure()
        Specified by:
        isAllowHalfClosure in interface io.netty.channel.socket.DuplexChannelConfig
      • setAllowHalfClosure

        public EpollSocketChannelConfig setAllowHalfClosure​(boolean allowHalfClosure)
        Specified by:
        setAllowHalfClosure in interface io.netty.channel.socket.DuplexChannelConfig
        Specified by:
        setAllowHalfClosure in interface io.netty.channel.socket.SocketChannelConfig
      • setConnectTimeoutMillis

        public EpollSocketChannelConfig setConnectTimeoutMillis​(int connectTimeoutMillis)
        Specified by:
        setConnectTimeoutMillis in interface io.netty.channel.ChannelConfig
        Specified by:
        setConnectTimeoutMillis in interface io.netty.channel.socket.SocketChannelConfig
        Overrides:
        setConnectTimeoutMillis in class EpollChannelConfig
      • setMaxMessagesPerRead

        @Deprecated
        public EpollSocketChannelConfig setMaxMessagesPerRead​(int maxMessagesPerRead)
        Deprecated.
        Specified by:
        setMaxMessagesPerRead in interface io.netty.channel.ChannelConfig
        Specified by:
        setMaxMessagesPerRead in interface io.netty.channel.socket.DuplexChannelConfig
        Specified by:
        setMaxMessagesPerRead in interface io.netty.channel.socket.SocketChannelConfig
        Overrides:
        setMaxMessagesPerRead in class EpollChannelConfig
      • setWriteSpinCount

        public EpollSocketChannelConfig setWriteSpinCount​(int writeSpinCount)
        Specified by:
        setWriteSpinCount in interface io.netty.channel.ChannelConfig
        Specified by:
        setWriteSpinCount in interface io.netty.channel.socket.DuplexChannelConfig
        Specified by:
        setWriteSpinCount in interface io.netty.channel.socket.SocketChannelConfig
        Overrides:
        setWriteSpinCount in class EpollChannelConfig
      • setAllocator

        public EpollSocketChannelConfig setAllocator​(io.netty.buffer.ByteBufAllocator allocator)
        Specified by:
        setAllocator in interface io.netty.channel.ChannelConfig
        Specified by:
        setAllocator in interface io.netty.channel.socket.DuplexChannelConfig
        Specified by:
        setAllocator in interface io.netty.channel.socket.SocketChannelConfig
        Overrides:
        setAllocator in class EpollChannelConfig
      • setRecvByteBufAllocator

        public EpollSocketChannelConfig setRecvByteBufAllocator​(io.netty.channel.RecvByteBufAllocator allocator)
        Specified by:
        setRecvByteBufAllocator in interface io.netty.channel.ChannelConfig
        Specified by:
        setRecvByteBufAllocator in interface io.netty.channel.socket.DuplexChannelConfig
        Specified by:
        setRecvByteBufAllocator in interface io.netty.channel.socket.SocketChannelConfig
        Overrides:
        setRecvByteBufAllocator in class EpollChannelConfig
      • setAutoRead

        public EpollSocketChannelConfig setAutoRead​(boolean autoRead)
        Specified by:
        setAutoRead in interface io.netty.channel.ChannelConfig
        Specified by:
        setAutoRead in interface io.netty.channel.socket.DuplexChannelConfig
        Specified by:
        setAutoRead in interface io.netty.channel.socket.SocketChannelConfig
        Overrides:
        setAutoRead in class EpollChannelConfig
      • setAutoClose

        public EpollSocketChannelConfig setAutoClose​(boolean autoClose)
        Specified by:
        setAutoClose in interface io.netty.channel.ChannelConfig
        Specified by:
        setAutoClose in interface io.netty.channel.socket.DuplexChannelConfig
        Specified by:
        setAutoClose in interface io.netty.channel.socket.SocketChannelConfig
        Overrides:
        setAutoClose in class io.netty.channel.DefaultChannelConfig
      • setWriteBufferWaterMark

        public EpollSocketChannelConfig setWriteBufferWaterMark​(io.netty.channel.WriteBufferWaterMark writeBufferWaterMark)
        Specified by:
        setWriteBufferWaterMark in interface io.netty.channel.ChannelConfig
        Specified by:
        setWriteBufferWaterMark in interface io.netty.channel.socket.DuplexChannelConfig
        Specified by:
        setWriteBufferWaterMark in interface io.netty.channel.socket.SocketChannelConfig
        Overrides:
        setWriteBufferWaterMark in class EpollChannelConfig
      • setMessageSizeEstimator

        public EpollSocketChannelConfig setMessageSizeEstimator​(io.netty.channel.MessageSizeEstimator estimator)
        Specified by:
        setMessageSizeEstimator in interface io.netty.channel.ChannelConfig
        Specified by:
        setMessageSizeEstimator in interface io.netty.channel.socket.DuplexChannelConfig
        Specified by:
        setMessageSizeEstimator in interface io.netty.channel.socket.SocketChannelConfig
        Overrides:
        setMessageSizeEstimator in class EpollChannelConfig