public class DatagramSocketOptions extends NetworkOptions
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_BROADCAST
The default value of broadcast for the socket = false
|
static boolean |
DEFAULT_IPV6
The default value of use IP v6 = false
|
static boolean |
DEFAULT_LOOPBACK_MODE_DISABLED
The default value of loopback disabled = true
|
static String |
DEFAULT_MULTICAST_NETWORK_INTERFACE
The default value of multicast network interface = null
|
static int |
DEFAULT_MULTICAST_TIME_TO_LIVE
The default value of multicast disabled = -1
|
static boolean |
DEFAULT_REUSE_ADDRESS
The default value of reuse address = false
|
DEFAULT_LOG_ACTIVITY_FORMAT, DEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_PORT, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS
Constructor and Description |
---|
DatagramSocketOptions()
Default constructor
|
DatagramSocketOptions(DatagramSocketOptions other)
Copy constructor
|
DatagramSocketOptions(JsonObject json)
Constructor to create options from JSON
|
Modifier and Type | Method and Description |
---|---|
String |
getMulticastNetworkInterface()
Get the multicast network interface address
|
int |
getMulticastTimeToLive() |
int |
getReceiveBufferSize()
Return the TCP receive buffer size, in bytes
|
int |
getSendBufferSize()
Return the TCP send buffer size, in bytes.
|
int |
getTrafficClass() |
boolean |
isBroadcast() |
boolean |
isIpV6() |
boolean |
isLoopbackModeDisabled() |
DatagramSocketOptions |
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.
|
DatagramSocketOptions |
setBroadcast(boolean broadcast)
Set if the socket can send or receive broadcast packets
|
DatagramSocketOptions |
setIpV6(boolean ipV6)
Set if IP v6 should be used
|
DatagramSocketOptions |
setLogActivity(boolean logEnabled)
Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.
|
DatagramSocketOptions |
setLoopbackModeDisabled(boolean loopbackModeDisabled)
Set if loopback mode is disabled
|
DatagramSocketOptions |
setMulticastNetworkInterface(String multicastNetworkInterface)
Set the multicast network interface address
|
DatagramSocketOptions |
setMulticastTimeToLive(int multicastTimeToLive)
Set the multicast ttl value
|
DatagramSocketOptions |
setReceiveBufferSize(int receiveBufferSize)
Set the TCP receive buffer size
|
DatagramSocketOptions |
setReuseAddress(boolean reuseAddress)
Set the value of reuse address
|
DatagramSocketOptions |
setReusePort(boolean reusePort)
Set the value of reuse port.
|
DatagramSocketOptions |
setSendBufferSize(int sendBufferSize)
Set the TCP send buffer size
|
DatagramSocketOptions |
setTrafficClass(int trafficClass)
Set the value of traffic class
|
getActivityLogDataFormat, getLogActivity, isReuseAddress, isReusePort, toJson
public static final boolean DEFAULT_BROADCAST
public static final boolean DEFAULT_LOOPBACK_MODE_DISABLED
public static final int DEFAULT_MULTICAST_TIME_TO_LIVE
public static final String DEFAULT_MULTICAST_NETWORK_INTERFACE
public static final boolean DEFAULT_REUSE_ADDRESS
public static final boolean DEFAULT_IPV6
public DatagramSocketOptions()
public DatagramSocketOptions(DatagramSocketOptions other)
other
- the options to copypublic DatagramSocketOptions(JsonObject json)
json
- the JSONpublic int getSendBufferSize()
NetworkOptions
getSendBufferSize
in class NetworkOptions
public DatagramSocketOptions setSendBufferSize(int sendBufferSize)
NetworkOptions
setSendBufferSize
in class NetworkOptions
sendBufferSize
- the buffers size, in bytespublic int getReceiveBufferSize()
NetworkOptions
getReceiveBufferSize
in class NetworkOptions
public DatagramSocketOptions setReceiveBufferSize(int receiveBufferSize)
NetworkOptions
setReceiveBufferSize
in class NetworkOptions
receiveBufferSize
- the buffers size, in bytespublic DatagramSocketOptions setReuseAddress(boolean reuseAddress)
NetworkOptions
setReuseAddress
in class NetworkOptions
reuseAddress
- the value of reuse addresspublic DatagramSocketOptions setReusePort(boolean reusePort)
NetworkOptions
setReusePort
in class NetworkOptions
reusePort
- the value of reuse portpublic int getTrafficClass()
getTrafficClass
in class NetworkOptions
public DatagramSocketOptions setTrafficClass(int trafficClass)
NetworkOptions
setTrafficClass
in class NetworkOptions
trafficClass
- the value of traffic classpublic boolean isBroadcast()
public DatagramSocketOptions setBroadcast(boolean broadcast)
broadcast
- true if the socket can send or receive broadcast packetspublic boolean isLoopbackModeDisabled()
public DatagramSocketOptions setLoopbackModeDisabled(boolean loopbackModeDisabled)
loopbackModeDisabled
- true if loopback mode is disabledpublic int getMulticastTimeToLive()
public DatagramSocketOptions setMulticastTimeToLive(int multicastTimeToLive)
multicastTimeToLive
- the multicast ttl valuepublic String getMulticastNetworkInterface()
public DatagramSocketOptions setMulticastNetworkInterface(String multicastNetworkInterface)
multicastNetworkInterface
- the addresspublic boolean isIpV6()
public DatagramSocketOptions setIpV6(boolean ipV6)
ipV6
- true if IP v6 should be usedpublic DatagramSocketOptions setLogActivity(boolean logEnabled)
NetworkOptions
setLogActivity
in class NetworkOptions
logEnabled
- true for logging the network activitypublic DatagramSocketOptions setActivityLogDataFormat(ByteBufFormat activityLogDataFormat)
NetworkOptions
setActivityLogDataFormat
in class NetworkOptions
activityLogDataFormat
- the format to useCopyright © 2024 Eclipse. All rights reserved.