Available on crate feature
net only.Expand description
std UDP clients (net feature).
DataClient: receive-only data channel, unicast or multicast.CommandClient: sends validated requests, filters the configured peer and bounds every exchange by a deadline.RawCommandClient: unrestricted datagrams and socket controls.
Start with CommandClient::connect_handshake, then use
CommandClient::exchange for read-only requests; examples/probe.rs
shows both steps.
Not authenticated. Peer filtering is hygiene only. Queued datagrams are drained before each request, but NatNet replies carry no transaction id, so a late reply arriving after the drain can still be mistaken for the current one. Treat a failed write as an unknown remote outcome and reconcile it from your own application state.
Structs§
- Command
Client - A bounded command-channel UDP client. The configured
serveris checked by the transport before a datagram is accepted as a reply. Each transaction also filters message IDs and uses an absolute deadline, so unrelated same-peer traffic cannot extend a wait. Receive controls belong to the transaction; socket access and raw conversion are unavailable while keeping the safe client: - Data
Client - A receive-only NatNet data-channel UDP client.
- RawCommand
Client - An unrestricted command-channel UDP client. Raw operations intentionally live on this
distinct type. The safe client can be converted into it only by consuming the idle client
with
CommandClient::into_raw. A raw client can transmit arbitrary bytes, receive from any peer, and change socket options; those operations carry no command validation or transaction guarantee.
Enums§
- Handshake
Error - A bounded handshake failure. Unsupported replies retain their decoded SERVERINFO so callers can log the producer’s reported version.
- Tier1
Execution Error - A failed sequential Tier-1 execution.
- Tier1
Failure - A transport or command failure recorded by the Tier-1 executor.
- Tier1
Phase - The point in a Tier-1 transaction at which a failure occurred.
Constants§
- MAX_
COMMAND_ DATAGRAM - Largest datagram accepted by the safe command receive path.
- MAX_
IPV4_ UDP_ PAYLOAD - Largest IPv4 UDP payload. NatNet’s
u16header field is wider than this transport limit, so a request can fit its NatNet header and still be refused before socket I/O. - MIN_
DATA_ BUFFER - Smallest
DataClient::recvbuffer that can hold every IPv4 UDP datagram (MAX_IPV4_UDP_PAYLOAD, 65 507 bytes). A datagram longer than the receive buffer is truncated by the operating system without a portable indication. With a buffer of at least this size truncation cannot happen; with a shorter buffer, a datagram that fills it exactly may have been truncated and is reported as an error. - NAT_
UNRECOGNIZED_ REQUEST - Response for an unsupported NatNet command request.
CommandClientreturnsio::ErrorKind::Unsupportedwhen it receives this reply. NAT_UNRECOGNIZED_REQUEST — the reply a NatNet server sends to a request it does not recognize (NatNetTypes.hand the SDK samples define it as 100).