1 .\" Copyright (c) 1983, 1991 The Regents of the University of California.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
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
32 .\" Modified Fri Jul 23 22:07:54 1993 by Rik Faith <faith@cs.unc.edu>
33 .\" Modified 950727 by aeb, following a suggestion by Urs Thuermann
34 .\" <urs@isnogud.escape.de>
35 .\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond <esr@thyrsus.com>
36 .\" Modified 1998 by Andi Kleen
37 .\" 中文版 Copyright (c) 2002 byeyear 和 www.linuxforum.net
39 .TH LISTEN 2 "23 July 1993" "BSD Man Page" "Linux Programmer's Manual"
41 listen \- listen for connections on a socket 在一个套接字上倾听连接
43 .B #include <sys/socket.h>
45 .BI "int listen(int " s ", int " backlog );
51 使其能够自动接收到来的连接并且为连接队列指定一个长度限制.
64 指定未完成连接队列的最大长度.如果一个连接请求到达时未完成连接
67 或者,如果下层协议支持重发,那么这个连接请求将被忽略,这样客户端
73 它指定了已经完成连接正等待应用程序接收的套接字队列的长度,而不是
74 未完成连接的数目.未完成连接套接字队列的最大长度可以使用
75 .B tcp_max_syn_backlog
77 当打开syncookies时不存在逻辑上的最大长度,此设置将被忽略.参见
81 .SH "RETURN VALUE" "返回值"
82 函数执行成功时返回0.错误时返回\-1,并置相应错误代码.
100 .SH "CONFORMING TO" "兼容于"
101 Single Unix, 4.4BSD, POSIX 1003.1g.
111 (Linux 2.0&2.2中是128),它将被自动截断为
114 有的BSD系统(以及一些BSD扩展)将backlog值限制为5.
121 .B byeyear <love_my_love@263.net >
124 .SH "《中国linux论坛man手册页翻译计划》:"
125 .BI http://cmpp.linuxforum.net