成人免费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-15 10:21:09

man中文man

2011-08-24 16:48:36

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技術棧公眾號

主站蜘蛛池模板: 午夜一级做a爰片久久毛片 精品综合 | www.久久久.com| 日本a∨精品中文字幕在线 亚洲91视频 | 久久久国产精品 | 国产一区二区三区色淫影院 | 免费成人在线网站 | 最新中文字幕在线 | 国产成人精品久久二区二区91 | 国产黄视频在线播放 | 免费黄色网址视频 | 午夜电影在线播放 | 欧美日韩在线一区二区三区 | 日韩一区二区在线视频 | 日韩中文一区二区 | 91pao对白在线播放 | 国产成人在线免费 | 欧美性受xxx | 中文字幕一区二区三区不卡在线 | www.中文字幕.com | 欧美一区二区免费 | 亚洲男人的天堂网站 | 在线观看黄色电影 | 一区精品国产欧美在线 | 九九热这里只有精品在线观看 | 九久久| 亚洲91| 国产a视频| 国产激情免费视频 | 男人的天堂久久 | 国产精品久久久久久久久图文区 | 欧美 日韩 国产 在线 | 成人妇女免费播放久久久 | 婷婷综合| 99精品欧美一区二区蜜桃免费 | 超碰人人人 | 九色在线观看 | 日韩中文一区二区三区 | 日韩精品影院 | 美女毛片免费看 | 欧美一区二 | 亚洲精品日韩精品 |