Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
listen(2)							     listen(2)

Name
       listen -	listen for connections on a socket

Syntax
       listen(s, backlog)
       int s, backlog;

Description
       To accept connections, a	socket is first	created	with a call, a backlog
       for incoming connections	is specified with and then the connections are
       accepted	 with  the  call.  The call is needed only for sockets of type
       SOCK_STREAM or SOCK_SEQPACKET.

       The backlog parameter defines the maximum length	the queue  of  pending
       connections  may	 grow  to.   If	 a connection request arrives with the
       queue full, the client receives an error	with an	indication of ECONNRE-
       FUSED.

Restrictions
       The backlog is currently	limited	to 8.

Return Values
       A 0 return value	indicates success.  A -1 indicates an error.

Diagnostics
       The call	fails under the	following conditions:

       [EBADF]	      The argument s is	not a valid descriptor.

       [ENOTSOCK]     The argument s is	not a socket.

       [EOPNOTSUPP]   The socket is not	of a type that supports	the operation

See Also
       accept(2), connect(2), socket(2)

								     listen(2)

Name | Syntax | Description | Restrictions | Return Values | Diagnostics | See Also

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=listen&sektion=2&manpath=ULTRIX+4.2>

home | help