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#
| Name | Description |
|---|---|
bind | Opens a UDP socket bound to host and port. |
connect | Opens a UDP socket whose default peer is host on port. |
local_port | Returns the local port a UDP socket is bound to. |
recv_from | Receives one datagram into the front of buf without waiting. |
send_to | Sends buf as one datagram to host on port and returns how many bytes were sent. |