TransportWireFormat
The framed webtools-udp 2.x transport wire format: the 1-byte DatagramType prefix, the control-datagram encodings (keepaliveDatagram, probePingDatagram, probePongDatagram), and the unreliable application-data frame (unreliableDatagram). The handshake bootstrap stays plain UTF-8 text — see HandshakeWireFormat.
The datagram-type tag (byte 0)
| Byte 0 | Entry | Rest of datagram |
|---|---|---|
0x80 | DatagramType.KEEPALIVE | (empty) |
0x81 | DatagramType.PROBE_PING | 8-byte big-endian uint64 probe sequence |
0x82 | DatagramType.PROBE_PONG | 8-byte big-endian uint64 probe sequence (echoed) |
0x90 | DatagramType.UNRELIABLE | [channel:1] (2.0: always 0x00) + payload verbatim — channel-byte contract: see DEFAULT_UNRELIABLE_CHANNEL |
Boundary note
This is a wire break: there is no 1.x ↔ 2.x post-handshake interop. Both ends must be on webtools-udp 2.0.0+. A cross-major peer is caught at the handshake — the server's REGISTERED reply carries FRAMED_PROTOCOL_VERSION (REGISTERED 2) and a mismatch fails MultiConnectionUDPClient.handshake cleanly with an IncompatibleProtocolException.
Every other byte 0 — including the reliable-channel 0xA0/0xA1 frames — is listed in DatagramType's own value-space table; the complete wire reference is docs/webtools-udp-protocol.md.
Properties
The recommended output-idle interval, in milliseconds, between keepalive datagrams on a NAT'd path (~20 s). Moved here from HandshakeWireFormat.
The default link-quality probe interval, in milliseconds (1 s). Moved here from HandshakeWireFormat.
The unreliable channel id this build emits, always 0x00. A receiver drops a datagram whose channel byte is non-zero, with a WARN; see docs/webtools-udp-protocol.md for the full channel-byte contract.
The wire-protocol major this build speaks; the token in the REGISTERED 2 reply.
The minimum accepted link-quality probe interval, in milliseconds (250 ms). Connection.startProbe and MultiConnectionUDPClient.startProbe fail with an IllegalArgumentException for an intervalMillis below this floor - the value is rejected, never silently rounded up - and send exactly one probe per requested interval at or above it.
Functions
The bare keepalive datagram: a single DatagramType.KEEPALIVE tag byte, no body.
The probe-request datagram: [0x81][seq: 8-byte big-endian uint64].
The probe-reply datagram: [0x82][seq: 8-byte big-endian uint64], the sequence copied verbatim from the request.
The probe sequence carried by an 0x81/0x82 datagram, or null if the datagram is not exactly a tag byte plus an 8-byte big-endian sequence.
The channel id byte of an 0x90 datagram (byte 1), or null if the datagram is shorter than the 2-byte prefix.
Frames payload as an unreliable application datagram: [0x90][channel][payload…]. Framing is done here, at the application-data call site — never in the shared send seam, which also carries unframed control datagrams (keepalive, PONG, REGISTERED) that must not be double-framed.
The payload of an 0x90 datagram — bytes 2 onward — or null if the datagram is shorter than the 2-byte [0x90][channel] prefix.