listen(2)
_________________________________________________________________
listen System Call
Listen for connections on a socket.
_________________________________________________________________
SYNTAX
int listen (s, backlog)
int s;
int backlog;
PARAMETERS
s File descriptor of socket to listen on.
backlog Maximum number of waiting connections.
DESCRIPTION
To accept connections, a socket is first created with socket(), a
backlog for incoming connections is specified with listen(), and
then the connections are accepted with accept(). The listen call
applies only to sockets of type SOCK_STREAM or SOCK_PKTSTREAM.
The <backlog> parameter defines the maximum length to which the
queue of pending connections may grow. If a connection request
arrives with the queue full, the client will receive the error
[ECONNREFUSED].
In DG/UX the backlog is currently limited to SOMAXCONN. If a
backlog greater than SOMAXCONN is specified, the backlog will be
set SOMAXCONN; however no error notification will be returned.
SOMAXCONN is defined in <sys/socket.h>.
ACCESS CONTROL
None. (See domain-specific restrictions in related
documentation.)
RETURN VALUE
0 Completed successfully.
-1 An error occurred. Errno is set to indicate the
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
listen(2)
error.
EXCEPTIONS
Errno may be set to one of the following error codes:
EBADF The argument <s> is not an active valid
descriptor.
ENOTSOCK The argument <s> is not a socket.
EOPNOTSUPP The socket is not of a type that supports the
operation listen.
EINVAL Invalid argument.
ECONNREFUSED Queue of pending connections is full.
SEE ALSO
The related manual sections: inet(3N), inet(6F), unix_ipc(6F),
accept(2), connect(2), socket(2).
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)