Interface SocketChannelConfig

    • Method Detail

      • isTcpNoDelay

        boolean isTcpNoDelay()
        Gets the StandardSocketOptions.TCP_NODELAY option. Please note that the default value of this option is true unlike the operating system default (false). However, for some buggy platforms, such as Android, that shows erratic behavior with Nagle's algorithm disabled, the default value remains to be false.
      • setTcpNoDelay

        SocketChannelConfig setTcpNoDelay​(boolean tcpNoDelay)
        Sets the StandardSocketOptions.TCP_NODELAY option. Please note that the default value of this option is true unlike the operating system default (false). However, for some buggy platforms, such as Android, that shows erratic behavior with Nagle's algorithm disabled, the default value remains to be false.
      • getSoLinger

        int getSoLinger()
        Gets the StandardSocketOptions.SO_LINGER option.
      • setSoLinger

        SocketChannelConfig setSoLinger​(int soLinger)
        Sets the StandardSocketOptions.SO_LINGER option.
      • getSendBufferSize

        int getSendBufferSize()
        Gets the StandardSocketOptions.SO_SNDBUF option.
      • setSendBufferSize

        SocketChannelConfig setSendBufferSize​(int sendBufferSize)
        Sets the StandardSocketOptions.SO_SNDBUF option.
      • getReceiveBufferSize

        int getReceiveBufferSize()
        Gets the StandardSocketOptions.SO_RCVBUF option.
      • setReceiveBufferSize

        SocketChannelConfig setReceiveBufferSize​(int receiveBufferSize)
        Sets the StandardSocketOptions.SO_RCVBUF option.
      • isKeepAlive

        boolean isKeepAlive()
        Gets the StandardSocketOptions.SO_KEEPALIVE option.
      • setKeepAlive

        SocketChannelConfig setKeepAlive​(boolean keepAlive)
        Sets the StandardSocketOptions.SO_KEEPALIVE option.
      • getTrafficClass

        int getTrafficClass()
        Gets the StandardSocketOptions.IP_TOS option.
      • setTrafficClass

        SocketChannelConfig setTrafficClass​(int trafficClass)
        Sets the StandardSocketOptions.IP_TOS option.
      • isReuseAddress

        boolean isReuseAddress()
        Gets the StandardSocketOptions.SO_REUSEADDR option.
      • setReuseAddress

        SocketChannelConfig setReuseAddress​(boolean reuseAddress)
        Sets the StandardSocketOptions.SO_REUSEADDR option.
      • setPerformancePreferences

        SocketChannelConfig setPerformancePreferences​(int connectionTime,
                                                      int latency,
                                                      int bandwidth)
        Sets the performance preferences as specified in Socket.setPerformancePreferences(int, int, int).
      • isAllowHalfClosure

        boolean isAllowHalfClosure()
        Returns true if and only if the channel should not close itself when its remote peer shuts down output to make the connection half-closed. If false, the connection is closed automatically when the remote peer shuts down output.
      • setConnectTimeoutMillis

        SocketChannelConfig setConnectTimeoutMillis​(int connectTimeoutMillis)
        Description copied from interface: ChannelConfig
        Sets the connect timeout of the channel in milliseconds. If the Channel does not support connect operation, this property is not used at all, and therefore will be ignored.
        Specified by:
        setConnectTimeoutMillis in interface ChannelConfig
        Parameters:
        connectTimeoutMillis - the connect timeout in milliseconds. 0 to disable.
      • setWriteSpinCount

        SocketChannelConfig setWriteSpinCount​(int writeSpinCount)
        Description copied from interface: ChannelConfig
        Sets the maximum loop count for a write operation until WritableByteChannel.write(ByteBuffer) returns a non-zero value. It is similar to what a spin lock is used for in concurrency programming. It improves memory utilization and write throughput depending on the platform that JVM runs on. The default value is 16.
        Specified by:
        setWriteSpinCount in interface ChannelConfig