c

Definition

accept (C)

#include <sys/socket.h>
 
int accept(
	int sockfd,
	struct sockaddr *_Nullable restrict addr,
	socklen_t *_Nullable restrict addrlen
);

The accept() system call is used with connection-based socket types (SOCK_STREAM, SOCK_SEQPACKET). It extracts the first connection request on the queue of pending connections for the listening socket, sockfd, creates a new connected socket, and returns a new file descriptor referring to that socket. The newly created socket is not in the listening state. The original socket sockfd is unaffected by this call.

Includes: socket.h