public class TcpKeepaliveOption extends EDNSOption
OPTRecordEDNSOption.Code| Modifier and Type | Field and Description |
|---|---|
private java.lang.Integer |
timeout
the timeout
|
private static java.time.Duration |
UPPER_LIMIT
upper limit of the duration (exclusive)
|
| Constructor and Description |
|---|
TcpKeepaliveOption()
Constructor for an option with no timeout
|
TcpKeepaliveOption(java.time.Duration t)
Constructor for an option with a given timeout.
|
TcpKeepaliveOption(int t)
Constructor for an option with a given timeout.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.OptionalInt |
getTimeout()
Returns the timeout.
|
java.util.Optional<java.time.Duration> |
getTimeoutDuration()
Returns the timeout as a
Duration. |
(package private) void |
optionFromWire(DNSInput in)
Converts the wire format of an EDNS Option (the option data only) into the type-specific
format.
|
(package private) java.lang.String |
optionToString()
Returns a string representation of the option parameters.
|
(package private) void |
optionToWire(DNSOutput out)
Converts an EDNS Option (the type-specific option data only) into wire format.
|
private java.lang.Integer timeout
private static final java.time.Duration UPPER_LIMIT
public TcpKeepaliveOption()
public TcpKeepaliveOption(int t)
t - the timeout time in 100ms units, may not be negative or larger than 65535public TcpKeepaliveOption(java.time.Duration t)
Duration class, values are rounded down.t - the timeout time, must not be negative and must be lower than 6553.5 secondspublic java.util.OptionalInt getTimeout()
public java.util.Optional<java.time.Duration> getTimeoutDuration()
Duration.void optionFromWire(DNSInput in) throws java.io.IOException
optionFromWire in class EDNSOptionin - The input stream.java.io.IOExceptionvoid optionToWire(DNSOutput out)
optionToWire in class EDNSOptionout - The output stream.java.lang.String optionToString()
optionToString in class EDNSOption