SYNOPSIS
#include <sys/socket.h>
int listen(int s, int backlog);
DESCRIPTION
The
The backlog parameter of this function is typically used by servers that could have more than one connection request at a time: if a connection request arrives with the queue full, the client receives an error with an indication of ECONNREFUSED.
An application may call
backlog is limited (silently) to a reasonable value as determined by the underlying service provider. Illegal values are replaced by the nearest legal value.
PARAMETERS
- s
-
Is a descriptor identifying a bound, unconnected socket.
- backlog
-
Is the maximum length that the queue of pending connections may grow to. If this value is SOMAXCONN, then the underlying service provider responsible for socket s sets the backlog to a maximum "reasonable" value.
RETURN VALUES
If successful,
- EBADF
-
s is not a valid descriptor
- EINCONN
-
s is already connected.
- EINVAL
-
s has not been bound to a local address.
- EMFILE
-
No more socket descriptors are available.
- ENETDOWN
-
Network subsystem has failed.
- ENOBUFS
-
No buffer space is available.
- ENOTSOCK
-
s is not a socket
- EOPNOTSUPP
-
s is not a socket that supports
listen() .
CONFORMANCE
UNIX 98, with exceptions.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
The NuTCRACKER Platform supports all the address families that WinSock 2.0 supports.
Applications may not call
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
PTC MKS Toolkit 10.4 Documentation Build 39.