Microservices
UDP
The UDP link, one frame per datagram, for unary calls and events.
The UDP link sends one frame per datagram and replies to the sender's address.
app.bind(ulo_rpc::Server::new(ulo_rpc_udp::Udp::new("0.0.0.0:7001")));What it does not do
- Streams. Only unary calls and events. A server that mounts a handler with a streamed shape is refused when it prepares, and a client refuses
stream,send_streamandduplexbefore any I/O withUnimplementedand the reasonshape_unsupported.requestis the call for one reply. - Delivery. Datagrams are unordered and nothing is retried. A lost request or reply is the caller's
Timeout. - Large payloads. A frame is at most 65,507 bytes, envelope included. A larger payload fails with
BadRequestand the reasonpayload_too_large. - TLS. DTLS is not supported and
Udphas notlsmethod. - Host names. The endpoint is an IP address and port. The link resolves no host name, and an inherited socket is refused because the activation adopts listening TCP sockets only.
Settings
| Method | Effect |
|---|---|
Udp::new(endpoint) | text, a SocketAddr or an Endpoint |
codec(Codec) | JSON by default; Codec::Cbor carries raw bytes |
with_handle(Handle) | the tokio runtime for the link's sockets and tasks, when it is built outside one |
Behaviour shared with TCP
The server answers a pattern with no handler itself: unavailable, reason pattern_unhandled. Calls are addressed to a server, max_inflight applies, and at the drain the server answers unavailable to every request its socket already holds.
A datagram that arrives after the socket has closed reaches no one, and its caller sees its own Timeout. The link declares its drain unconfirmed for that reason.