Module compiler

io::net::udp

A UDP socket is a Stream bound with bind. connect fixes a default peer for write; send_to and recv_from name the peer on each datagram.

Built into the compiler.

Import what you use (use path::* is not allowed):

use io::net::udp::{bind, connect};

Functions#

NameDescription
bindOpens a UDP socket bound to host and port.
connectOpens a UDP socket whose default peer is host on port.
local_portReturns the local port a UDP socket is bound to.
recv_fromReceives one datagram into the front of buf without waiting.
send_toSends buf as one datagram to host on port and returns how many bytes were sent.
↑ ↓ navigate ↵ open