Package io.vertx.core.net
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 Summary
Fields Modifier and Type Field Description static ByteBufFormat
DEFAULT_LOG_ACTIVITY_FORMAT
The default logActivity is ByteBufFormat.SIMPLEstatic boolean
DEFAULT_LOG_ENABLED
The default log enabled = falsestatic int
DEFAULT_RECEIVE_BUFFER_SIZE
The default value of TCP receive buffer sizestatic boolean
DEFAULT_REUSE_ADDRESS
The default value of reuse addressstatic boolean
DEFAULT_REUSE_PORT
The default value of reuse portstatic int
DEFAULT_SEND_BUFFER_SIZE
The default value of TCP send buffer sizestatic int
DEFAULT_TRAFFIC_CLASS
The default value of traffic class
-
Constructor Summary
Constructors Constructor Description NetworkOptions()
Default constructorNetworkOptions(JsonObject json)
Constructor from JSONNetworkOptions(NetworkOptions other)
Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufFormat
getActivityLogDataFormat()
boolean
getLogActivity()
int
getReceiveBufferSize()
Return the TCP receive buffer size, in bytesint
getSendBufferSize()
Return the TCP send buffer size, in bytes.int
getTrafficClass()
boolean
isReuseAddress()
boolean
isReusePort()
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.NetworkOptions
setLogActivity(boolean logActivity)
Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.NetworkOptions
setReceiveBufferSize(int receiveBufferSize)
Set the TCP receive buffer sizeNetworkOptions
setReuseAddress(boolean reuseAddress)
Set the value of reuse addressNetworkOptions
setReusePort(boolean reusePort)
Set the value of reuse port.NetworkOptions
setSendBufferSize(int sendBufferSize)
Set the TCP send buffer sizeNetworkOptions
setTrafficClass(int trafficClass)
Set the value of traffic classJsonObject
toJson()
Convert to JSON
-
-
-
Field Detail
-
DEFAULT_SEND_BUFFER_SIZE
public static final int DEFAULT_SEND_BUFFER_SIZE
The default value of TCP send buffer size- See Also:
- Constant Field Values
-
DEFAULT_RECEIVE_BUFFER_SIZE
public static final int DEFAULT_RECEIVE_BUFFER_SIZE
The default value of TCP receive buffer size- See Also:
- Constant Field Values
-
DEFAULT_TRAFFIC_CLASS
public static final int DEFAULT_TRAFFIC_CLASS
The default value of traffic class- See Also:
- Constant Field Values
-
DEFAULT_REUSE_ADDRESS
public static final boolean DEFAULT_REUSE_ADDRESS
The default value of reuse address- See Also:
- Constant Field Values
-
DEFAULT_REUSE_PORT
public static final boolean DEFAULT_REUSE_PORT
The default value of reuse port- See Also:
- Constant Field Values
-
DEFAULT_LOG_ENABLED
public static final boolean DEFAULT_LOG_ENABLED
The default log enabled = false- See Also:
- Constant Field Values
-
DEFAULT_LOG_ACTIVITY_FORMAT
public static final ByteBufFormat DEFAULT_LOG_ACTIVITY_FORMAT
The default logActivity is ByteBufFormat.SIMPLE
-
-
Constructor Detail
-
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 Detail
-
toJson
public JsonObject toJson()
Convert to JSON- Returns:
- the JSON
-
getSendBufferSize
public int getSendBufferSize()
Return the TCP send buffer size, in bytes.- Returns:
- the send buffer size
-
setSendBufferSize
public 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 int getReceiveBufferSize()
Return the TCP receive buffer size, in bytes- Returns:
- the receive buffer size
-
setReceiveBufferSize
public 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 boolean isReuseAddress()
- Returns:
- the value of reuse address
-
setReuseAddress
public 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 int getTrafficClass()
- Returns:
- the value of traffic class
-
setTrafficClass
public 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 boolean isReusePort()
- Returns:
- the value of reuse address - only supported by native transports
-
setReusePort
public 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
-
-