listen for connections on a socket
cc ... -lsocket
int listen (s, backlog)
int s, backlog;
To accept connections, a socket
is first created with
a backlog for incoming connections is specified with
and then the connections are
call applies only to sockets of type
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 receives an error
with an indication of ECONNREFUSED.
A return value of zero indicates that the call succeeded.
A return value of -1 indicates that an error occurred, and in this
case an error code is stored in the global variable errno.
The call fails if:
The s argument is not a valid descriptor.
The s argument does not point to a socket.
The socket is not of a type that supports the
The backlog is currently limited (silently) to 5.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003