Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ listen.bsd(2) — Domain/IX SR9.2.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

accept(2)

connect(2)

socket(2)

LISTEN(2)

NAME

listen − listen for connections on a socket

USAGE

listen(s, backlog)
int s, backlog;

DESCRIPTION

To accept connections, a socket is created with socket(2), a backlog for incoming connections is specified with listen(2), and the connections are accepted with accept(2). 

The backlog parameter defines the maximum length of the queue of pending connections.  If a connection request arrives and the queue is full, the client will receive the error ECONNREFUSED. 

NOTES

The maximum backlog is five. 

The listen call applies only to sockets of the type SOCK_STREAM or SOCK_PKTSTREAM. 

RETURN VALUE

A zero return value indicates success; −1 indicates an error. 

ERRORS

The call fails if:

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

[ENOTSOCK] The argument s is not a socket. 

[EOPNOTSUPP] Listen does not support this type of socket. 

RELATED INFORMATION

accept(2), connect(2), socket(2)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026