baml.net.UdpSocket
A UDP socket. Created by `baml.net.UdpSocket.bind`. UDP is connectionless and message-oriented: every `send_to` / `recv_from` carries a single datagram.
Signature
class baml.net.UdpSocketA UDP socket. Created by baml.net.UdpSocket.bind. UDP is connectionless and
message-oriented: every send_to / recv_from carries a single datagram.
Source:<builtin>/baml/ns_net/net.bamlbytes 2991–4878
Fields
_handle
$rust_type(internal)
Static methods
Binds to addr (e.g. "0.0.0.0:0" for an OS-assigned ephemeral port) and
returns the socket.
Instance methods
_recv_from
((internal)
_send_to
((internal)
Closes the socket.
recv_from
(Receives a single datagram, returning its payload bytes together with the address of the sender.
timeout bounds the wait for a datagram; null (the default) blocks
indefinitely. On expiry this throws baml.errors.Timeout and the socket
remains usable. Mirrors UdpSocket::set_read_timeout.
send_to
(Sends data as a single datagram to addr. Returns the number of bytes sent.
timeout bounds the send; null (the default) blocks indefinitely. On
expiry this throws baml.errors.Timeout. Mirrors UdpSocket::set_write_timeout.
Implementations
baml.Concrete for T
Source:<builtin>/baml/core.bamlbytes 747–779