Skip to main content

Module net

Module net 

Source
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§

CommandClient
A bounded command-channel UDP client. The configured server is 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:
DataClient
A receive-only NatNet data-channel UDP client.
RawCommandClient
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§

HandshakeError
A bounded handshake failure. Unsupported replies retain their decoded SERVERINFO so callers can log the producer’s reported version.
Tier1ExecutionError
A failed sequential Tier-1 execution.
Tier1Failure
A transport or command failure recorded by the Tier-1 executor.
Tier1Phase
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 u16 header 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::recv buffer 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. CommandClient returns io::ErrorKind::Unsupported when it receives this reply. NAT_UNRECOGNIZED_REQUEST — the reply a NatNet server sends to a request it does not recognize (NatNetTypes.h and the SDK samples define it as 100).