Function rustix::net::socket

pub fn socket(domain: AddressFamily, type_: SocketType, protocol: Protocol) -> io::Result<OwnedFd>
Documentation

socket(domain, type_, protocol)—Creates a socket.

POSIX guarantees that socket will use the lowest unused file descriptor, however it is not safe in general to rely on this, as file descriptors may be unexpectedly allocated on other threads or in libraries.

References