UDPConnection
The production Connection: a socket-free handle to one multiplexed client of a MultiConnectionUDPServer.
It owns no socket and no thread of its own. push and keepAlive address peer over the server's single shared socket; actuate registers this connection's message handler in the server's registry, while terminate now fully deregisters it - not just unregisters the handler. Every fallible operation returns a Result. A scheduled keepalive (startKeepAlive) runs on the server's shared mcups-keepalive thread - still not one owned here - and is cancelled by terminate. An opt-in link-quality probe (startProbe) likewise runs on the server's shared mcups-probe thread and is cancelled by terminate.
Instances are minted only by MultiConnectionUDPServer's internal factory - the constructor is internal. Standalone bidirectional-socket users take UDPSendReceiveServer directly.
Properties
Functions
Registers onMessage as the handler for datagrams from this client. No socket is bound - the server already owns the one shared socket; this only routes inbound datagrams whose source matches peer to onMessage. Calling this on a connection that has been terminated is a silent no-op (see terminate). The handler receives the trimmed UTF-8 text of each datagram; for a binary protocol use actuateBytes instead.
The delivery-mode-scoped handle for this connection. Each DeliveryMode has its own sequence space and its own inbound handler - binding a handler on one mode's UdpChannel never disturbs the other's.
The latest link-quality snapshot for this connection, delegated to ClientChannel.
Starts the scheduled keepalive at the recommended interval (TransportWireFormat.DEFAULT_KEEPALIVE_INTERVAL_MILLIS, 20 s).
Unlike the Connection default, this production implementation does support a scheduled keepalive: it delegates to the server's shared mcups-keepalive executor via ClientChannel, which sends an idle-aware 0x80 keepalive to peer on the given cadence. A non-positive intervalMillis surfaces as the ClientChannel's IllegalArgumentException failure. The schedule is cancelled by stopKeepAlive and by terminate.
Starts the probe at the default interval (TransportWireFormat.DEFAULT_PROBE_INTERVAL_MILLIS, 1 s).
Unlike the Connection default, this production implementation does support a link-quality probe: it delegates to the server's shared mcups-probe executor via ClientChannel, which sends a periodic 0x81 probe to peer and folds each 0x82 reply into a per-connection estimator. A non-positive intervalMillis or an unregistered peer surfaces as the ClientChannel's failure. The schedule is cancelled by stopProbe and by terminate.
Unlike the Connection default no-op, this production implementation cancels the keepalive armed by startKeepAlive on the server's shared mcups-keepalive executor via ClientChannel. Idempotent; terminate also does this.
Unlike the Connection default no-op, this production implementation cancels the probe armed by startProbe on the server's shared mcups-probe executor via ClientChannel. Idempotent; terminate also does this.
Fully deregisters this connection: its message handler is cleared and its registration is removed from the server entirely, so it is no longer addressed by MultiConnectionUDPServer.pushToAll and any subsequent datagram from peer is dropped as unregistered. This is final - calling actuate again afterward is a silent no-op, since there is no longer a registration to bind against; the client must complete a fresh Iam handshake to be registered again.