Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

listen(2) [hpux man page]

listen(2)							System Calls Manual							 listen(2)

NAME
listen - listen for connections on a socket SYNOPSIS
DESCRIPTION
To accept connections, a socket is first created using a queue for incoming connections is activated using and then connections are accepted using applies only to unconnected sockets of type SOCK_STREAM. Except for AF_VME_LINK, if the socket has not been bound to a local port before is invoked, the system automatically binds a local port for the socket to listen on (see inet(7F)). For sockets in the address family AF_CCITT and AF_VME_LINK, the socket be bound to an address by using before connection establishment can continue, otherwise an error is returned. A listen queue is established for the socket specified by the s parameter, which is a socket descriptor. backlog defines the desirable queue length for pending connections. The actual queue length may be greater than the specified backlog. If a connection request arrives when the queue is full, the client will receive an error. backlog is limited to the range of 0 to which is defined in is currently set to 4096. If any other value is specified, the system automat- ically assigns the closest value within the range. Note that for a backlog of 0 specifies only 1 pending connection is allowed at any given time. For a backlog of 0 specifies no further connection is allowed. X/Open Sockets Compilation Environment See xopen_networking(7). DEPENDENCIES
AF_CCITT Call-acceptance can be controlled by the call described in Upon successful completion, returns 0; otherwise, it returns -1 and sets to indicate the error. ERRORS
fails if any of the following conditions are encountered: s is not a valid file descriptor. The socket s has not been bound to an address by using s is a valid file descriptor but it is not a socket. The socket referenced by s does not support The socket has been shut down or is already connected. WARNINGS
Linking binary objects compiled to specification and binary objects compiled to specification to the same executable may result in unex- pected behavior, including application abnormal termination and unexpected socket errors. See xopen_networking(7) for details and remedy. FUTURE DIRECTION
Currently, the default behavior is the however, it might be changed to in a future release. At that time, any behavior that is incompati- ble with might be obsoleted. Applications that conform to the X/Open specification now will avoid migration problems (see xopen_network- ing(7)). AUTHOR
was developed by HP and the University of California, Berkeley. SEE ALSO
accept(2), connect(2), socket(2), thread_safety(5), xopen_networking(7), inet(7F). STANDARDS CONFORMANCE
listen(2)

Check Out this Related Man Page

socketpair(2)							System Calls Manual						     socketpair(2)

NAME
socketpair() - create a pair of connected sockets SYNOPSIS
DESCRIPTION
The system call creates an unnamed pair of connected sockets and returns two file descriptors in sv[0] and sv[1]. The two sockets are indistinguishable. af specifies the address family. See socket(2). type specifies the semantics of communication for the socket. proto- col specifies a particular protocol to be used. protocol can be specified as zero, which causes the system to choose a protocol type to use. X/Open Sockets Compilation Environment See xopen_networking(7). RETURN VALUE
returns the following values: Successful completion. Failure. is set to indicate the error. ERRORS
If fails, is set to one of the following values. The specified address family is not supported in this version of the system. The sv parameter is not valid. The per-process file descriptor table is full. The system file table is temporarily full. No buffer space is available for the operation to complete. The specified protocol does not support creation of socket pairs. The specified protocol is not supported in this version of the system. DEPENDENCIES
is supported only for AF_UNIX. WARNINGS
Linking binary objects compiled to specification and binary objects compiled to specification to the same executable may result in unex- pected behavior, including application abnormal termination and unexpected socket errors. See xopen_networking(7) for details and remedy. FUTURE DIRECTION
Currently, the default behavior is the however, it might be changed to in a future release. At that time, any behavior that is incompati- ble with might be obsoleted. Applications that conform to the X/Open specification now will avoid migration problems (see xopen_network- ing(7)). AUTHOR
was developed by HP and the University of California, Berkeley. SEE ALSO
read(2), socket(2), write(2), privileges(5), thread_safety(5), xopen_networking(7). STANDARDS CONFORMANCE
socketpair(2)
Man Page