Struct std::net::SocketAddrUnstable
[-] [+]
[src]
pub struct SocketAddr { // some fields omitted }
Representation of a socket address for networking applications
A socket address consists of at least an (ip, port) pair and may also contain other information depending on the protocol.
Methods
impl SocketAddr
fn new(ip: IpAddr, port: u16) -> SocketAddr
Creates a new socket address from the (ip, port) pair.
fn ip(&self) -> IpAddr
Gets the IP address associated with this socket address.
fn port(&self) -> u16
Gets the port number associated with this socket address