Class NetworkOptions

    • Field Detail

      • DEFAULT_SEND_BUFFER_SIZE

        public static final int DEFAULT_SEND_BUFFER_SIZE
        The default value of TCP send buffer size
        See Also:
        Constant Field Values
      • DEFAULT_RECEIVE_BUFFER_SIZE

        public static final int DEFAULT_RECEIVE_BUFFER_SIZE
        The default value of TCP receive buffer size
        See Also:
        Constant Field Values
      • DEFAULT_TRAFFIC_CLASS

        public static final int DEFAULT_TRAFFIC_CLASS
        The default value of traffic class
        See Also:
        Constant Field Values
      • DEFAULT_REUSE_ADDRESS

        public static final boolean DEFAULT_REUSE_ADDRESS
        The default value of reuse address
        See Also:
        Constant Field Values
      • DEFAULT_REUSE_PORT

        public static final boolean DEFAULT_REUSE_PORT
        The default value of reuse port
        See Also:
        Constant Field Values
      • DEFAULT_LOG_ENABLED

        public static final boolean DEFAULT_LOG_ENABLED
        The default log enabled = false
        See Also:
        Constant Field Values
      • DEFAULT_LOG_ACTIVITY_FORMAT

        public static final ByteBufFormat DEFAULT_LOG_ACTIVITY_FORMAT
        The default logActivity is ByteBufFormat.SIMPLE
    • Constructor Detail

      • NetworkOptions

        public NetworkOptions()
        Default constructor
      • NetworkOptions

        public NetworkOptions​(NetworkOptions other)
        Copy constructor
        Parameters:
        other - the options to copy
      • NetworkOptions

        public NetworkOptions​(JsonObject json)
        Constructor from JSON
        Parameters:
        json - the JSON
    • Method Detail

      • toJson

        public JsonObject toJson()
        Convert to JSON
        Returns:
        the JSON
      • getSendBufferSize

        public int getSendBufferSize()
        Return the TCP send buffer size, in bytes.
        Returns:
        the send buffer size
      • setSendBufferSize

        public NetworkOptions setSendBufferSize​(int sendBufferSize)
        Set the TCP send buffer size
        Parameters:
        sendBufferSize - the buffers size, in bytes
        Returns:
        a reference to this, so the API can be used fluently
      • getReceiveBufferSize

        public int getReceiveBufferSize()
        Return the TCP receive buffer size, in bytes
        Returns:
        the receive buffer size
      • setReceiveBufferSize

        public NetworkOptions setReceiveBufferSize​(int receiveBufferSize)
        Set the TCP receive buffer size
        Parameters:
        receiveBufferSize - the buffers size, in bytes
        Returns:
        a reference to this, so the API can be used fluently
      • isReuseAddress

        public boolean isReuseAddress()
        Returns:
        the value of reuse address
      • setReuseAddress

        public NetworkOptions setReuseAddress​(boolean reuseAddress)
        Set the value of reuse address
        Parameters:
        reuseAddress - the value of reuse address
        Returns:
        a reference to this, so the API can be used fluently
      • getTrafficClass

        public int getTrafficClass()
        Returns:
        the value of traffic class
      • setTrafficClass

        public NetworkOptions setTrafficClass​(int trafficClass)
        Set the value of traffic class
        Parameters:
        trafficClass - the value of traffic class
        Returns:
        a reference to this, so the API can be used fluently
      • getLogActivity

        public boolean getLogActivity()
        Returns:
        true when network activity logging is enabled
      • getActivityLogDataFormat

        public ByteBufFormat getActivityLogDataFormat()
        Returns:
        Netty's logging handler's data format.
      • setLogActivity

        public NetworkOptions setLogActivity​(boolean logActivity)
        Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.
        Parameters:
        logActivity - true for logging the network activity
        Returns:
        a reference to this, so the API can be used fluently
      • setActivityLogDataFormat

        public NetworkOptions setActivityLogDataFormat​(ByteBufFormat activityLogDataFormat)
        Set the value of Netty's logging handler's data format: Netty's pipeline is configured for logging on Netty's logger.
        Parameters:
        activityLogDataFormat - the format to use
        Returns:
        a reference to this, so the API can be used fluently
      • isReusePort

        public boolean isReusePort()
        Returns:
        the value of reuse address - only supported by native transports
      • setReusePort

        public NetworkOptions setReusePort​(boolean reusePort)
        Set the value of reuse port.

        This is only supported by native transports.

        Parameters:
        reusePort - the value of reuse port
        Returns:
        a reference to this, so the API can be used fluently