lliisstteenn() -- Sockets Function (libsocket)

Listen for a connection on a socket
#iinncclluuddee <ssyyss/ssoocckkeett.hh>
iinntt lliisstteenn(_s_o_c_k_e_t, _b_a_c_k_l_o_g)
iinntt _s_o_c_k_e_t, iinntt _b_a_c_k_l_o_g;

Function lliisstteenn()  ``listens'' for a connection on  _s_o_c_k_e_t. It also signals
the  system  your process's  willingness  to accept  a  connection on  that
socket.   This function  applies  only to  sockets of  type SSOOCCKK_SSTTRREEAAMM  or
SSOOCCKK_SSEEQQPPAACCKKEETT.

_s_o_c_k_e_t is  a file  descriptor that identifies  the socket in  question.  It
must have been returned by a  call to ssoocckkeett(). _b_a_c_k_l_o_g defines the maximum
length to  which the  queue of  pending connections may  grow.  As  of this
writing, _b_a_c_k_l_o_g is limited to a  maximum of five.  If a connection request
arrives  with the  queue full,  the  client may  receive an  error with  an
indication  of  EECCOONNNNRREEFFUUSSEEDD;   or  if  the  underlying  protocol  supports
retransmission, the request may be ignored so that retries may succeed.

If all goes well, lliisstteenn() returns zero.  If an error occurs, it returns -1
and sets  eerrrrnnoo to  an appropriate value.   The following lists  the errors
that can occur, by the value to which lliisstteenn() sets eerrrrnnoo:

EEBBAADDFF
     _s_o_c_k_e_t is not a valid descriptor.

_E_N_O_T_S_O_C_K
     _s_o_c_k_e_t does not identify a socket.

EEOOPPNNOOTTSSUUPPPP
     _s_o_c_k_e_t is not of a type that supports lliisstteenn().

_E_x_a_m_p_l_e
For an example of this function, see the Lexicon entry for lliibbssoocckkeett.

_S_e_e _A_l_s_o
aacccceepptt(), ccoonnnneecctt(), lliibbssoocckkeett, ssoocckkeett()
