Skip to main content

Module udp

Module udp 

Source
Expand description

UDP Socket Operations for Seq

Provides non-blocking UDP datagram operations using May’s coroutine-aware I/O. udp.receive-from yields the strand while waiting for a datagram instead of blocking the OS thread.

These functions are exported with C ABI for LLVM codegen.

§Payloads are byte-clean

Datagrams carry whatever bytes the wire delivered — no UTF-8 validation. Binary protocols (DNS records, NTP packets, OSC int32 / float32 arguments, multicast TLV, MessagePack-over-UDP) round-trip through udp.send-to / udp.receive-from byte for byte. See docs/design/STRING_BYTE_CLEANLINESS.md for the SeqString design that makes this possible.

Re-exports§

pub use patch_seq_udp_bind as udp_bind;
pub use patch_seq_udp_close as udp_close;
pub use patch_seq_udp_receive_from as udp_receive_from;
pub use patch_seq_udp_send_to as udp_send_to;

Functions§

patch_seq_udp_bind
Bind a UDP socket to a local port.
patch_seq_udp_close
Close a UDP socket and free its handle.
patch_seq_udp_receive_from
Receive one datagram from a UDP socket.
patch_seq_udp_send_to
Send a datagram to a host:port from a bound UDP socket.