Package io.vertx.core.datagram
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 Summary
Fields Modifier and Type Field Description static booleanDEFAULT_BROADCASTThe default value of broadcast for the socket = falsestatic booleanDEFAULT_IPV6The default value of use IP v6 = falsestatic booleanDEFAULT_LOOPBACK_MODE_DISABLEDThe default value of loopback disabled = truestatic StringDEFAULT_MULTICAST_NETWORK_INTERFACEThe default value of multicast network interface = nullstatic intDEFAULT_MULTICAST_TIME_TO_LIVEThe default value of multicast disabled = -1static booleanDEFAULT_REUSE_ADDRESSThe default value of reuse address = false-
Fields inherited from class io.vertx.core.net.NetworkOptions
DEFAULT_LOG_ACTIVITY_FORMAT, DEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_PORT, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS
-
-
Constructor Summary
Constructors Constructor Description DatagramSocketOptions()Default constructorDatagramSocketOptions(DatagramSocketOptions other)Copy constructorDatagramSocketOptions(JsonObject json)Constructor to create options from JSON
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetMulticastNetworkInterface()Get the multicast network interface addressintgetMulticastTimeToLive()intgetReceiveBufferSize()Return the TCP receive buffer size, in bytesintgetSendBufferSize()Return the TCP send buffer size, in bytes.intgetTrafficClass()booleanisBroadcast()booleanisIpV6()booleanisLoopbackModeDisabled()DatagramSocketOptionssetActivityLogDataFormat(ByteBufFormat activityLogDataFormat)Set the value of Netty's logging handler's data format: Netty's pipeline is configured for logging on Netty's logger.DatagramSocketOptionssetBroadcast(boolean broadcast)Set if the socket can send or receive broadcast packetsDatagramSocketOptionssetIpV6(boolean ipV6)Set if IP v6 should be usedDatagramSocketOptionssetLogActivity(boolean logEnabled)Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.DatagramSocketOptionssetLoopbackModeDisabled(boolean loopbackModeDisabled)Set if loopback mode is disabledDatagramSocketOptionssetMulticastNetworkInterface(String multicastNetworkInterface)Set the multicast network interface addressDatagramSocketOptionssetMulticastTimeToLive(int multicastTimeToLive)Set the multicast ttl valueDatagramSocketOptionssetReceiveBufferSize(int receiveBufferSize)Set the TCP receive buffer sizeDatagramSocketOptionssetReuseAddress(boolean reuseAddress)Set the value of reuse addressDatagramSocketOptionssetReusePort(boolean reusePort)Set the value of reuse port.DatagramSocketOptionssetSendBufferSize(int sendBufferSize)Set the TCP send buffer sizeDatagramSocketOptionssetTrafficClass(int trafficClass)Set the value of traffic class-
Methods inherited from class io.vertx.core.net.NetworkOptions
getActivityLogDataFormat, getLogActivity, isReuseAddress, isReusePort, toJson
-
-
-
-
Field Detail
-
DEFAULT_BROADCAST
public static final boolean DEFAULT_BROADCAST
The default value of broadcast for the socket = false- See Also:
- Constant Field Values
-
DEFAULT_LOOPBACK_MODE_DISABLED
public static final boolean DEFAULT_LOOPBACK_MODE_DISABLED
The default value of loopback disabled = true- See Also:
- Constant Field Values
-
DEFAULT_MULTICAST_TIME_TO_LIVE
public static final int DEFAULT_MULTICAST_TIME_TO_LIVE
The default value of multicast disabled = -1- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
DEFAULT_IPV6
public static final boolean DEFAULT_IPV6
The default value of use IP v6 = false- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
getSendBufferSize
public int getSendBufferSize()
Description copied from class:NetworkOptionsReturn the TCP send buffer size, in bytes.- Overrides:
getSendBufferSizein classNetworkOptions- Returns:
- the send buffer size
-
setSendBufferSize
public DatagramSocketOptions setSendBufferSize(int sendBufferSize)
Description copied from class:NetworkOptionsSet the TCP send buffer size- Overrides:
setSendBufferSizein classNetworkOptions- 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:NetworkOptionsReturn the TCP receive buffer size, in bytes- Overrides:
getReceiveBufferSizein classNetworkOptions- Returns:
- the receive buffer size
-
setReceiveBufferSize
public DatagramSocketOptions setReceiveBufferSize(int receiveBufferSize)
Description copied from class:NetworkOptionsSet the TCP receive buffer size- Overrides:
setReceiveBufferSizein classNetworkOptions- Parameters:
receiveBufferSize- the buffers size, in bytes- Returns:
- a reference to this, so the API can be used fluently
-
setReuseAddress
public DatagramSocketOptions setReuseAddress(boolean reuseAddress)
Description copied from class:NetworkOptionsSet the value of reuse address- Overrides:
setReuseAddressin classNetworkOptions- Parameters:
reuseAddress- the value of reuse address- Returns:
- a reference to this, so the API can be used fluently
-
setReusePort
public DatagramSocketOptions setReusePort(boolean reusePort)
Description copied from class:NetworkOptionsSet the value of reuse port. This is only supported by native transports.- Overrides:
setReusePortin classNetworkOptions- Parameters:
reusePort- the value of reuse port- Returns:
- a reference to this, so the API can be used fluently
-
getTrafficClass
public int getTrafficClass()
- Overrides:
getTrafficClassin classNetworkOptions- Returns:
- the value of traffic class
-
setTrafficClass
public DatagramSocketOptions setTrafficClass(int trafficClass)
Description copied from class:NetworkOptionsSet the value of traffic class- Overrides:
setTrafficClassin classNetworkOptions- 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:NetworkOptionsSet to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.- Overrides:
setLogActivityin classNetworkOptions- 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:NetworkOptionsSet the value of Netty's logging handler's data format: Netty's pipeline is configured for logging on Netty's logger.- Overrides:
setActivityLogDataFormatin classNetworkOptions- Parameters:
activityLogDataFormat- the format to use- Returns:
- a reference to this, so the API can be used fluently
-
-