Package org.xbill.DNS

Class TcpKeepaliveOption

java.lang.Object
org.xbill.DNS.EDNSOption
org.xbill.DNS.TcpKeepaliveOption
All Implemented Interfaces:
Serializable

public class TcpKeepaliveOption extends EDNSOption
TCP Keepalive EDNS0 Option, as defined in https://datatracker.ietf.org/doc/html/rfc7828
See Also:
  • Field Details

    • timeout

      private Integer timeout
      the timeout
    • UPPER_LIMIT

      private static final Duration UPPER_LIMIT
      upper limit of the duration (exclusive)
  • Constructor Details

    • TcpKeepaliveOption

      public TcpKeepaliveOption()
      Constructor for an option with no timeout
    • TcpKeepaliveOption

      public TcpKeepaliveOption(int t)
      Constructor for an option with a given timeout.
      Parameters:
      t - the timeout time in 100ms units, may not be negative or larger than 65535
    • TcpKeepaliveOption

      public TcpKeepaliveOption(Duration t)
      Constructor for an option with a given timeout. As the timeout has a coarser granularity than the Duration class, values are rounded down.
      Parameters:
      t - the timeout time, must not be negative and must be lower than 6553.5 seconds
  • Method Details

    • getTimeout

      public OptionalInt getTimeout()
      Returns the timeout.
      Returns:
      the timeout in 100ms units
    • getTimeoutDuration

      public Optional<Duration> getTimeoutDuration()
      Returns the timeout as a Duration.
      Returns:
      the timeout
    • optionFromWire

      void optionFromWire(DNSInput in) throws IOException
      Converts the wire format of an EDNS Option (the option data only) into the type-specific format.
      Specified by:
      optionFromWire in class EDNSOption
      Parameters:
      in - The input stream.
      Throws:
      IOException
    • optionToWire

      void optionToWire(DNSOutput out)
      Converts an EDNS Option (the type-specific option data only) into wire format.
      Specified by:
      optionToWire in class EDNSOption
      Parameters:
      out - The output stream.
    • optionToString

      String optionToString()
      Returns a string representation of the option parameters.
      Specified by:
      optionToString in class EDNSOption
      Returns:
      the string representation