Class TpcSocketConfig


  • @Beta
    public class TpcSocketConfig
    extends java.lang.Object
    Socket configuration for TPC. In TPC, each eventloop has its own sockets.
    Since:
    5.3
    See Also:
    TpcConfig
    • Field Detail

      • DEFAULT_RECEIVE_BUFFER_SIZE_KB

        public static final int DEFAULT_RECEIVE_BUFFER_SIZE_KB
        See Also:
        SocketOptions.SO_RCVBUF, Constant Field Values
      • DEFAULT_SEND_BUFFER_SIZE_KB

        public static final int DEFAULT_SEND_BUFFER_SIZE_KB
        See Also:
        SocketOptions.SO_SNDBUF, Constant Field Values
    • Constructor Detail

      • TpcSocketConfig

        public TpcSocketConfig()
    • Method Detail

      • getPortRange

        @Nonnull
        public java.lang.String getPortRange()
        Gets the possible port range for TPC sockets to bind. Can't return null.
        Returns:
        the port range string
      • setPortRange

        @Nonnull
        public TpcSocketConfig setPortRange​(@Nonnull
                                            java.lang.String portRange)
        Sets the possible port range for TPC sockets to bind. Can't return null.
        Parameters:
        portRange - the port range to set
        Returns:
        this TPC socket config
        Throws:
        java.lang.IllegalArgumentException - if portRange doesn't match \d{1,5}-\d{1,5} regular expression
        java.lang.NullPointerException - if portRange is null
      • getReceiveBufferSizeKB

        public int getReceiveBufferSizeKB()
        Gets the receive-buffer size of the TPC sockets in kilobytes.
        Returns:
        the receive-buffer size of the TPC sockets in kilobytes
        See Also:
        SocketOptions.SO_RCVBUF
      • setReceiveBufferSizeKB

        @Nonnull
        public TpcSocketConfig setReceiveBufferSizeKB​(int receiveBufferSizeKB)
        Sets the receive-buffer size of the TPC sockets in kilobytes. Can't return null.
        Parameters:
        receiveBufferSizeKB - the receive-buffer size of the TPC sockets in kilobytes
        Returns:
        this TPC socket config
        Throws:
        java.lang.IllegalArgumentException - if receiveBufferSizeKB isn't positive
        See Also:
        SocketOptions.SO_RCVBUF
      • getSendBufferSizeKB

        public int getSendBufferSizeKB()
        Gets the send-buffer size of the TPC sockets in kilobytes.
        Returns:
        the send-buffer size of the TPC sockets in kilobytes
        See Also:
        SocketOptions.SO_SNDBUF
      • setSendBufferSizeKB

        @Nonnull
        public TpcSocketConfig setSendBufferSizeKB​(int sendBufferSizeKB)
        Sets the send-buffer size of the TPC sockets in kilobytes. Can't return null.
        Parameters:
        sendBufferSizeKB - the send-buffer size of the TPC sockets in kilobytes
        Returns:
        this TPC socket config
        Throws:
        java.lang.IllegalArgumentException - if sendBufferSizeKB isn't positive
        See Also:
        SocketOptions.SO_SNDBUF
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object