Listen for connections on a socket
#include <sys/socket.h> int listen( int s, int backlog );
socket3r.lib, socket3s.lib
The listen() function listens for connections on a socket and puts the socket into the LISTEN state. For connections to be accepted, the following must occur:
The backlog parameter defines the maximum length that the queue of pending connections may grow to. If a connection request arrives with the queue full, the client may receive an error with an indication of ECONNREFUSED. But if the underlying protocol supports retransmission, the request may be ignored so that retries may succeed.
The listen() call applies only to SOCK_STREAM sockets. |
Standard Unix, POSIX 1003.1g (draft)
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |