3 accept \- accepts incoming connections on a socket
6 #include <sys/socket.h>
10 int accept(int \fIsd\fP, struct sockaddr * \fIaddr\fP, socklen_t * \fIaddr_len\fP);
14 accept() accepts a new incoming connection on a listening
15 socket \fIsd\fP. The structure pointed to by \fIaddr\fP is
16 filled in with the address of the peer, and \fIaddr_len\fP
17 is set to the length of the address of the peer.
19 On success, this function returns a numeric socket descriptor.
20 On error, -1 is returned and \fIerrno\fP is set.
24 The socket does not support accept(2) (example: a UDP socket).
27 The \fIsd\fP argument is not a socket.
30 The socket is not listening or in an invalid state.