rustix::net

Function accept

source
pub fn accept<Fd: AsFd>(sockfd: Fd) -> Result<OwnedFd>
Expand description

accept(fd, NULL, NULL)—Accepts an incoming connection.

Use acceptfrom to retrieve the peer address.

POSIX guarantees that accept 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