Skip to main content

sockaddr_to_std

Function sockaddr_to_std 

Source
pub fn sockaddr_to_std(
    storage: &sockaddr_storage,
    len: socklen_t,
) -> Result<SocketAddr>
Expand description

Convert a sockaddr_storage (as filled in by recvfrom/recvmsg) into a SocketAddr, given the address length the kernel reported.

ยงErrors

Returns an error if len is too short for the address family the kernel reported, or if the family is neither AF_INET nor AF_INET6.