Manual Reference Pages - LISTEN (2)
- listen for connections on a socket
Interaction With Accept Filters
listen int s int backlog
To accept connections, a socket
is first created with
a willingness to accept incoming connections and
a queue limit for incoming connections are specified with
and then the connections are
system call applies only to sockets of type
argument defines the maximum length the queue of
pending connections may grow to.
The real maximum queue length will be 1.5 times more than the value
specified in the
system call on the listening socket allows the caller to change the maximum
queue length using a new
If a connection
request arrives with the queue full the client may
receive an error with an indication of
or, in the case of TCP, the connection will be
Current queue lengths of listening sockets can be queried using
Note that before
and the introduction of the syncache,
argument also determined the length of the incomplete
connection queue, which held TCP sockets in the process
of completing TCPs 3-way handshake.
These incomplete connections
are now held entirely in the syncache, which is unaffected by
values to help handle denial
of service attacks are no longer necessary.
specifies a hard limit on
if a value greater than
or less than zero is specified,
is silently forced to
INTERACTION WITH ACCEPT FILTERS
When accept filtering is used on a socket, a second queue will
be used to hold sockets that have connected, but have not yet
met their accept filtering criteria.
Once the criteria has been
met, these sockets will be moved over into the completed connection
queue to be
accept 2 ed.
If this secondary queue is full and a
new connection comes in, the oldest socket which has not yet met
its accept filter criteria will be terminated.
This secondary queue, like the primary listen queue, is sized
according to the
.Rv -std listen
will fail if:
is not a valid descriptor.
The socket is not bound to a local address, and the protocol does not
support listening on an unbound socket.
The socket is already connected, or in the process of being connected.
is not a socket.
The socket is not of a type that supports the operation
system call appeared in
BSD 4.2 .
The ability to configure the maximum
at run-time, and to use a negative
to request the maximum allowable value, was introduced in
.Fx 2.2 .
has been replaced with
to prevent confusion about its actual functionality.
is still available but hidden from a
-a output so that existing applications and scripts continue to work.
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.