Class NetworkOptions

java.lang.Object
io.vertx.core.net.NetworkOptions
Direct Known Subclasses:
DatagramSocketOptions, TCPSSLOptions

public abstract class NetworkOptions extends Object
Author:
Tim Fox
  • Field Details

    • DEFAULT_SEND_BUFFER_SIZE

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

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

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

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

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

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

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

    • 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 Details

    • toJson

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

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

      public abstract 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 abstract int getReceiveBufferSize()
      Return the TCP receive buffer size, in bytes
      Returns:
      the receive buffer size
    • setReceiveBufferSize

      public abstract 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 abstract boolean isReuseAddress()
      Returns:
      the value of reuse address
    • setReuseAddress

      public abstract 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 abstract int getTrafficClass()
      Returns:
      the value of traffic class
    • setTrafficClass

      public abstract 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 abstract boolean isReusePort()
      Returns:
      the value of reuse address - only supported by native transports
    • setReusePort

      public abstract 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