Class UnsupportedVersionException

All Implemented Interfaces:
Serializable

public final class UnsupportedVersionException extends PacketDecodeException
A long header packet of a version this endpoint does not speak. A server answers it with a Version Negotiation packet (versionNegotiation(int...)) when the datagram is at least 1200 bytes (RFC 9000 section 6.1). The connection IDs follow the version-independent invariants (RFC 8999), so they may be up to 255 bytes long.
See Also:
  • Constructor Details

    • UnsupportedVersionException

      public UnsupportedVersionException(int version, byte[] destinationId, byte[] sourceId)
      An unsupported version.
      Parameters:
      version - the version number in the packet
      destinationId - the packet's Destination Connection ID
      sourceId - the packet's Source Connection ID
  • Method Details

    • version

      public int version()
      The version number in the packet.
      Returns:
      the 32-bit version
    • destinationId

      public byte[] destinationId()
      The packet's Destination Connection ID.
      Returns:
      a copy of its 0 to 255 bytes
    • sourceId

      public byte[] sourceId()
      The packet's Source Connection ID.
      Returns:
      a copy of its 0 to 255 bytes
    • versionNegotiation

      public byte[] versionNegotiation(int... supportedVersions)
      The Version Negotiation packet that answers this packet: the connection IDs swapped and the supported versions listed (RFC 9000 section 17.2.1).
      Parameters:
      supportedVersions - the version numbers to offer, often with a reserved one added
      Returns:
      the packet bytes