Class DatagramSocketOptions
java.lang.Object
io.vertx.core.net.NetworkOptions
io.vertx.core.datagram.DatagramSocketOptions
Options used to configure a datagram socket.
- Author:
- Tim Fox
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanThe default value of broadcast for the socket = falsestatic final booleanThe default value of use IP v6 = falsestatic final booleanThe default value of loopback disabled = truestatic final StringThe default value of multicast network interface = nullstatic final intThe default value of multicast disabled = -1static final booleanThe default value of reuse address = falseFields inherited from class NetworkOptions
DEFAULT_LOG_ACTIVITY_FORMAT, DEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_PORT, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorCopy constructorConstructor to create options from JSON -
Method Summary
Modifier and TypeMethodDescriptionGet the multicast network interface addressintintReturn the TCP receive buffer size, in bytesintReturn the TCP send buffer size, in bytes.intbooleanbooleanisIpV6()booleanbooleanbooleansetActivityLogDataFormat(ByteBufFormat activityLogDataFormat) Set the value of Netty's logging handler's data format: Netty's pipeline is configured for logging on Netty's logger.setBroadcast(boolean broadcast) Set if the socket can send or receive broadcast packetssetIpV6(boolean ipV6) Set if IP v6 should be usedsetLogActivity(boolean logEnabled) Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.setLoopbackModeDisabled(boolean loopbackModeDisabled) Set if loopback mode is disabledsetMulticastNetworkInterface(String multicastNetworkInterface) Set the multicast network interface addresssetMulticastTimeToLive(int multicastTimeToLive) Set the multicast ttl valuesetReceiveBufferSize(int receiveBufferSize) Set the TCP receive buffer sizesetReuseAddress(boolean reuseAddress) Set the value of reuse addresssetReusePort(boolean reusePort) Set the value of reuse port.setSendBufferSize(int sendBufferSize) Set the TCP send buffer sizesetTrafficClass(int trafficClass) Set the value of traffic classtoJson()Convert to JSONMethods inherited from class NetworkOptions
getActivityLogDataFormat, getLogActivity
-
Field Details
-
DEFAULT_BROADCAST
public static final boolean DEFAULT_BROADCASTThe default value of broadcast for the socket = false- See Also:
-
DEFAULT_LOOPBACK_MODE_DISABLED
public static final boolean DEFAULT_LOOPBACK_MODE_DISABLEDThe default value of loopback disabled = true- See Also:
-
DEFAULT_MULTICAST_TIME_TO_LIVE
public static final int DEFAULT_MULTICAST_TIME_TO_LIVEThe default value of multicast disabled = -1- See Also:
-
DEFAULT_MULTICAST_NETWORK_INTERFACE
The default value of multicast network interface = null -
DEFAULT_REUSE_ADDRESS
public static final boolean DEFAULT_REUSE_ADDRESSThe default value of reuse address = false- See Also:
-
DEFAULT_IPV6
public static final boolean DEFAULT_IPV6The default value of use IP v6 = false- See Also:
-
-
Constructor Details
-
DatagramSocketOptions
public DatagramSocketOptions()Default constructor -
DatagramSocketOptions
Copy constructor- Parameters:
other- the options to copy
-
DatagramSocketOptions
Constructor to create options from JSON- Parameters:
json- the JSON
-
-
Method Details
-
isReusePort
public boolean isReusePort()- Specified by:
isReusePortin classNetworkOptions- Returns:
- the value of reuse address - only supported by native transports
-
setReusePort
Description copied from class:NetworkOptionsSet the value of reuse port. This is only supported by native transports.- Specified by:
setReusePortin classNetworkOptions- 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:NetworkOptionsReturn the TCP send buffer size, in bytes.- Specified by:
getSendBufferSizein classNetworkOptions- Returns:
- the send buffer size
-
setSendBufferSize
Description copied from class:NetworkOptionsSet the TCP send buffer size- Specified by:
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- Specified by:
getReceiveBufferSizein classNetworkOptions- Returns:
- the receive buffer size
-
setReceiveBufferSize
Description copied from class:NetworkOptionsSet the TCP receive buffer size- Specified by:
setReceiveBufferSizein classNetworkOptions- 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:
isReuseAddressin classNetworkOptions- Returns:
- the value of reuse address
-
setReuseAddress
Description copied from class:NetworkOptionsSet the value of reuse address- Specified by:
setReuseAddressin classNetworkOptions- 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:
getTrafficClassin classNetworkOptions- Returns:
- the value of traffic class
-
setTrafficClass
Description copied from class:NetworkOptionsSet the value of traffic class- Specified by:
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
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
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
Set the multicast ttl value- Parameters:
multicastTimeToLive- the multicast ttl value- Returns:
- a reference to this, so the API can be used fluently
-
getMulticastNetworkInterface
Get the multicast network interface address- Returns:
- the interface address
-
setMulticastNetworkInterface
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
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
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
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
-
toJson
Description copied from class:NetworkOptionsConvert to JSON- Specified by:
toJsonin classNetworkOptions- Returns:
- the JSON
-