aurpc
Asynchronous UDP RPCs.
Exposes a socket-like interface allowing for sending requests and awaiting a response as well as listening to requests, with UDP as transport.
This is achieved by implementing an 24-bit protocol header on top of UDP containing 8-bit flags and a 16-bit request id.
1 2
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Flags | Request Id |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Since a UDP datagram can carry a maximum of 65507 data bytes. This means
that, with the added overhead, each message can be a maximum of 65504 bytes
.
Examples
use RpcSocket;
let socket = bind.await?;
let mut buf = vec!;
loop