Package-level declarations

Types

Link copied to clipboard
sealed interface Admission

The outcome of MultiConnectionUDPServer.admit - the pre-accept screening decision for an incoming Iam handshake, evaluated on the listener thread before the REGISTERED reply and before any same-name supersede.

Link copied to clipboard
interface Connection

A single named, logical connection to one remote client of a MultiConnectionUDPServer.

Link copied to clipboard

The datagram-type tag carried as byte 0 of every post-REGISTERED datagram on the framed webtools-udp 2.x transport. The listener switches on this byte before it ever looks at a payload, so control traffic and application traffic no longer share the trimmed-UTF-8 namespace that the pre-2.0 classifier collided on.

Link copied to clipboard

Which delivery guarantee a UdpChannel provides. Each entry has its own sequence space and its own inbound handler (see Connection.channel / UdpChannel.actuateBytes).

Link copied to clipboard

Why a Connection managed by a MultiConnectionUDPServer stopped being addressable, as reported to MultiConnectionUDPServer.onClientDisconnect.

Link copied to clipboard

The server refused the handshake during MultiConnectionUDPClient.handshake: it replied REFUSED <reason> rather than REGISTERED. Distinct from a timeout (the server never answered) and from a malformed reply.

Link copied to clipboard

The public, socket-free handshake-bootstrap wire format a client needs: the verb that opens a handshake (Iam <name> [<credential>]), the accepted reply (REGISTERED <version>), and the refusal reply (REFUSED <reason>).

Link copied to clipboard
class IncompatibleProtocolException(val remoteVersion: Int?, val localVersion: Int) : Exception

The server's handshake reply announced a different wire-protocol major than this build speaks. Raised by MultiConnectionUDPClient.handshake when the REGISTERED reply is not this build's exact REGISTERED 2: a bare REGISTERED from a pre-2.0 server (remoteVersion 1), or REGISTERED n for some other n.

Link copied to clipboard
data class LinkQuality(val rttMillis: Double, val rttVarianceMillis: Double, val packetLossRatio: Double, val probesSent: Long, val probesDelivered: Long)

A point-in-time snapshot of one connection's measured link quality, produced by the opt-in probe (MultiConnectionUDPClient.startProbe / Connection.startProbe). All figures come from the same instant, so RTT and loss are mutually consistent.

Link copied to clipboard

The client-side counterpart to MultiConnectionUDPServer: opens the Iam handshake, then owns the entire subsequent session, over one socket.

Link copied to clipboard

A UDP server that multiplexes all traffic for any number of clients over a single well-known "common" socket (COMMON_LISTEN_PORT).

Link copied to clipboard
class ReliableMessageTooLargeException(val sizeBytes: Int, val capBytes: Int) : ReliableSendFailure

A reliable message exceeded the configured cap. Never thrown; only ever the payload of a Result.failure from UdpChannel.send on a reliable channel. 2.0 does not fragment (docs/webtools-udp-protocol.md): split the message yourself, or raise reliableMaxMessageBytes up to UdpChannel.MAX_RELIABLE_MESSAGE_BYTES at the consumer's own IP-fragmentation risk. Unlike ReliableWindowFullException, this keeps its stack trace - it signals a programming or configuration mistake, where the trace is the diagnostic.

Link copied to clipboard
abstract class ReliableSendFailure(message: String) : Exception

The supertype of every failure a reliable UdpChannel.send can report. Deliberately open, not sealed: a caller can catch/is-check one type today, and a future reliable-send failure can join this hierarchy in a minor version without breaking anyone's exhaustive when. abstract because nothing should ever construct or throw the bare supertype - only ReliableWindowFullException and ReliableMessageTooLargeException do, and only ever as a Result.failure payload, never thrown.

Link copied to clipboard

The reliable in-flight window is full - inFlight messages are already awaiting acknowledgement. Never thrown; only ever the payload of a Result.failure from UdpChannel.send on a reliable channel - the sibling of HandshakeRefusedException in that respect. This is backpressure, not an error: retry after the next retransmit tick, coalesce the message with a later one, or drop it.

Link copied to clipboard

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.

Link copied to clipboard
interface UdpChannel

A delivery-mode-scoped view of one connection: send under this mode's guarantees, and bind the handler for traffic that arrives under it. Stateless and cheap - hold it, or fetch it per call; either is correct.

Link copied to clipboard

The production Connection: a socket-free handle to one multiplexed client of a MultiConnectionUDPServer.

Link copied to clipboard
class UDPSendReceiveServer @JvmOverloads constructor(targetAddress: InetAddress, sendPort: Int, listenPort: Int, receiveBufferBytes: Int = MultiConnectionUDPServer.DEFAULT_RECEIVE_BUFFER_BYTES) : AutoCloseable

A simple bidirectional UDP socket pair: one socket for sending to a fixed target address/port, and a separate socket bound to a local port for asynchronously receiving incoming datagrams on a background thread.

Functions

Link copied to clipboard

Determines this machine's outward-facing local address.