Deleted Added
full compact
listen.2 (108028) listen.2 (108087)
1.\" Copyright (c) 1983, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 16 unchanged lines hidden (view full) ---

25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" From: @(#)listen.2 8.2 (Berkeley) 12/11/93
1.\" Copyright (c) 1983, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 16 unchanged lines hidden (view full) ---

25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" From: @(#)listen.2 8.2 (Berkeley) 12/11/93
33.\" $FreeBSD: head/lib/libc/sys/listen.2 108028 2002-12-18 09:22:32Z ru $
33.\" $FreeBSD: head/lib/libc/sys/listen.2 108087 2002-12-19 09:40:28Z ru $
34.\"
35.Dd May 8, 2002
36.Dt LISTEN 2
37.Os
38.Sh NAME
39.Nm listen
40.Nd listen for connections on a socket
41.Sh LIBRARY

--- 17 unchanged lines hidden (view full) ---

59.Fn listen
60system call applies only to sockets of type
61.Dv SOCK_STREAM
62or
63.Dv SOCK_SEQPACKET .
64.Pp
65The
66.Fa backlog
34.\"
35.Dd May 8, 2002
36.Dt LISTEN 2
37.Os
38.Sh NAME
39.Nm listen
40.Nd listen for connections on a socket
41.Sh LIBRARY

--- 17 unchanged lines hidden (view full) ---

59.Fn listen
60system call applies only to sockets of type
61.Dv SOCK_STREAM
62or
63.Dv SOCK_SEQPACKET .
64.Pp
65The
66.Fa backlog
67parameter defines the maximum length the queue of
67argument defines the maximum length the queue of
68pending connections may grow to.
69If a connection
70request arrives with the queue full the client may
71receive an error with an indication of
72.Er ECONNREFUSED ,
73or, in the case of TCP, the connection will be
74silently dropped.
75.Pp
76Note that before
77.Fx 4.5
78and the introduction of the syncache,
79the
80.Fa backlog
68pending connections may grow to.
69If a connection
70request arrives with the queue full the client may
71receive an error with an indication of
72.Er ECONNREFUSED ,
73or, in the case of TCP, the connection will be
74silently dropped.
75.Pp
76Note that before
77.Fx 4.5
78and the introduction of the syncache,
79the
80.Fa backlog
81parameter also determined the length of the incomplete
81argument also determined the length of the incomplete
82connection queue, which held TCP sockets in the process
83of completing TCP's 3-way handshake.
84These incomplete connections
85are now held entirely in the syncache, which is unaffected by
86queue lengths.
87Inflated
88.Fa backlog
89values to help handle denial

--- 21 unchanged lines hidden (view full) ---

111.Xr accept 2 Ns ed .
112If this secondary queue is full and a
113new connection comes in, the oldest socket which has not yet met
114its accept filter criteria will be terminated.
115.Pp
116This secondary queue, like the primary listen queue, is sized
117according to the
118.Fa backlog
82connection queue, which held TCP sockets in the process
83of completing TCP's 3-way handshake.
84These incomplete connections
85are now held entirely in the syncache, which is unaffected by
86queue lengths.
87Inflated
88.Fa backlog
89values to help handle denial

--- 21 unchanged lines hidden (view full) ---

111.Xr accept 2 Ns ed .
112If this secondary queue is full and a
113new connection comes in, the oldest socket which has not yet met
114its accept filter criteria will be terminated.
115.Pp
116This secondary queue, like the primary listen queue, is sized
117according to the
118.Fa backlog
119parameter.
119argument.
120.Sh RETURN VALUES
121.Rv -std listen
122.Sh ERRORS
123The
124.Fn listen
125system call
126will fail if:
127.Bl -tag -width Er

--- 30 unchanged lines hidden ---
120.Sh RETURN VALUES
121.Rv -std listen
122.Sh ERRORS
123The
124.Fn listen
125system call
126will fail if:
127.Bl -tag -width Er

--- 30 unchanged lines hidden ---