成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

listen 中文man頁面

系統
在接收連接之前,首先要使用 socket(2) 創建一個套接字,然后調用 listen 使其能夠自動接收到來的連接并且為連接隊列指定一個長度限制. 之后就可以使用 accept(2) 接收連接. listen 調用僅適用于 SOCK_STREAM 或者 SOCK_SEQPACKET 類型的套接字.

NAME 名稱

listen - listen for connections on a socket 在一個套接字上傾聽連接  

SYNOPSIS 概述

#include <sys/socket.h>

int listen(int s, int backlog);  

DESCRIPTION 描述

在接收連接之前,首先要使用 socket(2) 創建一個套接字,然后調用 listen 使其能夠自動接收到來的連接并且為連接隊列指定一個長度限制. 之后就可以使用 accept(2) 接收連接. listen 調用僅適用于 SOCK_STREAM 或者 SOCK_SEQPACKET 類型的套接字.

參數 backlog 指定未完成連接隊列的***長度.如果一個連接請求到達時未完成連接隊列已滿,那么客戶端將接收到錯誤 ECONNREFUSED. 或者,如果下層協議支持重發,那么這個連接請求將被忽略,這樣客戶端在重試的時候就有成功的機會.  

NOTES 注意

在TCP套接字中 backlog 的含義在Linux 2.2中已經改變. 它指定了已經完成連接正等待應用程序接收的套接字隊列的長度,而不是未完成連接的數目.未完成連接套接字隊列的***長度可以使用 tcp_max_syn_backlog sysctl設置當打開syncookies時不存在邏輯上的***長度,此設置將被忽略.參見 tcp(7) 以獲取更多信息.

RETURN VALUE 返回值

函數執行成功時返回0.錯誤時返回-1,并置相應錯誤代碼. errno  

ERRORS 錯誤

EBADF
參數 s 不是合法的描述符.
ENOTSOCK
參數 s 不是一個套接字.
EOPNOTSUPP
套接字類型不支持 listen 操作.

CONFORMING TO 兼容于

Single Unix, 4.4BSD, POSIX 1003.1g. listen 函數調用最初出現于4.2BSD.  

BUGS 勘誤

如果套接字類型是 AF_INET, 并且參數 backlog 大于常量 SOMAXCONN (Linux 2.0&2.2中是128),它將被自動截斷為 SOMAXCONN 的值. 有的BSD系統(以及一些BSD擴展)將backlog值限制為5.  

SEE ALSO 參見

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

#p#

NAME

listen - listen for connections on a socket  

SYNOPSIS

#include <sys/socket.h>

int listen(int s, int backlog);  

DESCRIPTION

To accept connections, a socket is first created with socket(2), a willingness to accept incoming connections and a queue limit for incoming connections are specified with listen, and then the connections are accepted with accept(2). The listen call applies only to sockets of type SOCK_STREAM or SOCK_SEQPACKET.

The backlog parameter defines the maximum length the queue of pending connections may grow to. If a connection request arrives with the queue full the client may receive an error with an indication of ECONNREFUSED or, if the underlying protocol supports retransmission, the request may be ignored so that retries succeed.  

NOTES

The behaviour of the backlog parameter on TCP sockets changed with Linux 2.2. Now it specifies the queue length for completely established sockets waiting to be accepted, instead of the number of incomplete connection requests. The maximum length of the queue for incomplete sockets can be set using the tcp_max_syn_backlog sysctl. When syncookies are enabled there is no logical maximum length and this sysctl setting is ignored. See tcp(7) for more information.

RETURN VALUE

On success, zero is returned. On error, -1 is returned, and errno is set appropriately.  

ERRORS

EADDRINUSE
Another socket is already listening on the same port.
EBADF
The argument s is not a valid descriptor.
ENOTSOCK
The argument s is not a socket.
EOPNOTSUPP
The socket is not of a type that supports the listen operation.

CONFORMING TO

Single Unix, 4.4BSD, POSIX 1003.1g draft. The listen function call first appeared in 4.2BSD.  

BUGS

If the socket is of type AF_INET, and the backlog argument is greater than the constant SOMAXCONN (128 in Linux 2.0 & 2.2), it is silently truncated to SOMAXCONN. Don't rely on this value in portable applications since BSD (and some BSD-derived systems) limit the backlog to 5.  

SEE ALSO

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

責任編輯:韓亞珊 來源: CMPP.net
相關推薦

2011-08-24 16:16:07

LISTEN中文man

2011-08-24 16:48:36

man中文man

2011-08-15 10:21:09

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-11 15:03:21

ACCESS中文man

2011-08-11 15:28:43

ali中文man

2011-08-11 16:31:49

biff中文man

2011-08-11 17:16:43

cce中文man

2011-08-11 18:05:04

chvt中文man

2011-08-11 18:13:07

clear中文man

2011-08-12 09:13:02

df中文man

2011-08-12 09:38:06

dircolors中文man

2011-08-12 09:44:37

dirname中文man

2011-08-12 10:20:02

echo中文man

2011-08-12 10:25:55

eject中文man

2011-08-12 11:07:19

git中文man

2011-08-12 13:18:19

head中文man

2011-08-12 13:49:23

hostid中文man

2011-08-12 13:54:46

hostname中文man
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 欧美日韩久久久 | 超碰97人人人人人蜜桃 | 熟女毛片 | 亚洲高清视频在线 | 久久久久亚洲精品 | 久久久久久国产精品 | 91精品国产乱码久久久久久久久 | 国产高清久久久 | 欧美激情精品久久久久久 | 中国黄色毛片视频 | 亚洲欧美日韩国产综合 | 国产精品3区 | 国产精品成人一区二区三区夜夜夜 | 欧美精品成人一区二区三区四区 | 免费激情av| 国产精品亚洲综合 | 国产欧美在线播放 | 亚洲综合在线视频 | 国产日韩欧美在线观看 | 日韩高清一区 | 久久精品亚洲精品国产欧美 | 日韩欧美一区二区三区免费看 | 久久久国产精品一区 | 亚洲国产成人精品女人久久久野战 | 日韩欧美亚洲 | 极品销魂美女一区二区 | 九九热国产精品视频 | 中文字幕亚洲一区二区三区 | 成人免费视频网站在线观看 | 成人在线精品视频 | 密乳av| 国产一区二区三区在线观看免费 | 国产欧美性成人精品午夜 | 国产一区二区三区免费观看视频 | 黄频免费 | 一级看片 | 天天综合网永久 | 91热在线| 日日日操 | 亚洲精品久久 | 欧美精品在线观看 |