listen(2)listen(2)Namelisten - listen for connections on a socket
int s, backlog;
To accept connections, a socket is first created with a call, a backlog
for incoming connections is specified with and then the connections are
accepted with the call. The call is needed only for sockets of type
SOCK_STREAM or SOCK_SEQPACKET.
The backlog parameter defines the maximum length the queue of pending
connections may grow to. If a connection request arrives with the
queue full, the client receives an error with an indication of ECONNRE‐
The backlog is currently limited to 8.
A 0 return value indicates success. A -1 indicates an error.
The call fails under the following conditions:
[EBADF] The argument s is not a valid descriptor.
[ENOTSOCK] The argument s is not a socket.
[EOPNOTSUPP] The socket is not of a type that supports the operation
See Alsoaccept(2), connect(2), socket(2)listen(2)