First page Back Continue Last page Summary Graphics
accept
#include <sys/socket.s>
int accept (int socket, struct sockaddr *address, socklen_t *address_len);
Extracts the first connection on the queue of pending connections, creates a new socket with the same socket type protocol and address family as the specified socket, and allocates a new file descriptor for that socket.
If address is not a null pointer, the address of the peer for the accepted connection is stored in address, and its length is stored in address_len.
If the protocol permits connections by unbound clients, and the peer is not bound, then the value stored in address is unspecified.