Class DatagramSocketOptions

java.lang.Object
io.vertx.core.net.NetworkOptions
io.vertx.core.datagram.DatagramSocketOptions

public class DatagramSocketOptions extends NetworkOptions
Options used to configure a datagram socket.
Author:
Tim Fox
  • Field Details

    • DEFAULT_BROADCAST

      public static final boolean DEFAULT_BROADCAST
      The default value of broadcast for the socket = false
      See Also:
    • DEFAULT_LOOPBACK_MODE_DISABLED

      public static final boolean DEFAULT_LOOPBACK_MODE_DISABLED
      The default value of loopback disabled = true
      See Also:
    • DEFAULT_MULTICAST_TIME_TO_LIVE

      public static final int DEFAULT_MULTICAST_TIME_TO_LIVE
      The default value of multicast disabled = -1
      See Also:
    • DEFAULT_MULTICAST_NETWORK_INTERFACE

      public static final String DEFAULT_MULTICAST_NETWORK_INTERFACE
      The default value of multicast network interface = null
    • DEFAULT_REUSE_ADDRESS

      public static final boolean DEFAULT_REUSE_ADDRESS
      The default value of reuse address = false
      See Also:
    • DEFAULT_IPV6

      public static final boolean DEFAULT_IPV6
      The default value of use IP v6 = false
      See Also:
  • Constructor Details

    • DatagramSocketOptions

      public DatagramSocketOptions()
      Default constructor
    • DatagramSocketOptions

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

      public DatagramSocketOptions(JsonObject json)
      Constructor to create options from JSON
      Parameters:
      json - the JSON
  • Method Details

    • isReusePort

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

      public DatagramSocketOptions setReusePort(boolean reusePort)
      Description copied from class: NetworkOptions
      Set the value of reuse port.

      This is only supported by native transports.

      Specified by:
      setReusePort in class NetworkOptions
      Parameters:
      reusePort - the value of reuse port
      Returns:
      a reference to this, so the API can be used fluently
    • getSendBufferSize

      public int getSendBufferSize()
      Description copied from class: NetworkOptions
      Return the TCP send buffer size, in bytes.
      Specified by:
      getSendBufferSize in class NetworkOptions
      Returns:
      the send buffer size
    • setSendBufferSize

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

      public int getReceiveBufferSize()
      Description copied from class: NetworkOptions
      Return the TCP receive buffer size, in bytes
      Specified by:
      getReceiveBufferSize in class NetworkOptions
      Returns:
      the receive buffer size
    • setReceiveBufferSize

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

      public boolean isReuseAddress()
      Specified by:
      isReuseAddress in class NetworkOptions
      Returns:
      the value of reuse address
    • setReuseAddress

      public DatagramSocketOptions setReuseAddress(boolean reuseAddress)
      Description copied from class: NetworkOptions
      Set the value of reuse address
      Specified by:
      setReuseAddress in class NetworkOptions
      Parameters:
      reuseAddress - the value of reuse address
      Returns:
      a reference to this, so the API can be used fluently
    • getTrafficClass

      public int getTrafficClass()
      Specified by:
      getTrafficClass in class NetworkOptions
      Returns:
      the value of traffic class
    • setTrafficClass

      public DatagramSocketOptions setTrafficClass(int trafficClass)
      Description copied from class: NetworkOptions
      Set the value of traffic class
      Specified by:
      setTrafficClass in class NetworkOptions
      Parameters:
      trafficClass - the value of traffic class
      Returns:
      a reference to this, so the API can be used fluently
    • isBroadcast

      public boolean isBroadcast()
      Returns:
      true if the socket can send or receive broadcast packets?
    • setBroadcast

      public DatagramSocketOptions setBroadcast(boolean broadcast)
      Set if the socket can send or receive broadcast packets
      Parameters:
      broadcast - true if the socket can send or receive broadcast packets
      Returns:
      a reference to this, so the API can be used fluently
    • isLoopbackModeDisabled

      public boolean isLoopbackModeDisabled()
      Returns:
      true if loopback mode is disabled
    • setLoopbackModeDisabled

      public DatagramSocketOptions setLoopbackModeDisabled(boolean loopbackModeDisabled)
      Set if loopback mode is disabled
      Parameters:
      loopbackModeDisabled - true if loopback mode is disabled
      Returns:
      a reference to this, so the API can be used fluently
    • getMulticastTimeToLive

      public int getMulticastTimeToLive()
      Returns:
      the multicast ttl value
    • setMulticastTimeToLive

      public DatagramSocketOptions setMulticastTimeToLive(int multicastTimeToLive)
      Set the multicast ttl value
      Parameters:
      multicastTimeToLive - the multicast ttl value
      Returns:
      a reference to this, so the API can be used fluently
    • getMulticastNetworkInterface

      public String getMulticastNetworkInterface()
      Get the multicast network interface address
      Returns:
      the interface address
    • setMulticastNetworkInterface

      public DatagramSocketOptions setMulticastNetworkInterface(String multicastNetworkInterface)
      Set the multicast network interface address
      Parameters:
      multicastNetworkInterface - the address
      Returns:
      a reference to this, so the API can be used fluently
    • isIpV6

      public boolean isIpV6()
      Returns:
      true if IP v6 be used?
    • setIpV6

      public DatagramSocketOptions setIpV6(boolean ipV6)
      Set if IP v6 should be used
      Parameters:
      ipV6 - true if IP v6 should be used
      Returns:
      a reference to this, so the API can be used fluently
    • setLogActivity

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

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

      public JsonObject toJson()
      Description copied from class: NetworkOptions
      Convert to JSON
      Specified by:
      toJson in class NetworkOptions
      Returns:
      the JSON