Listens for connection requests on a socket.
int listen( int s, int backlog );
s
backlog
For a server application to accept connections, it must first create a socket with socket( ), then specify a backlog for incoming connection requests with listen. To complete a connection, accept connection requests with accept.
A listen(s, 0) call succeeds and sets a connection queue length of 0. This causes all connect attempts to the listening port to fail, an error. A listen(s, 1) call accepts only a single connection with no pending requests allowed.
0
(zero)
-1
and the function sets errno to one of these values
EBADF |
Invalid file descriptor or file not opened for writing. |
ENOSPC |
No space left on device. |
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 | intime/rt/include/sys/socket.h | sys/types.h sys/socket.h |
netiff3m.lib |