litsunglin / baserver

Automatically exported from code.google.com/p/baserver
0 stars 0 forks source link

测试echo程序发现大量的time-wait连接,为什么 #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
1.我在使用你的ehco的测试例子,进行测试,发现client机子断��
�会出现大量的time-wait连接,知道端口全被占用,测试失败。

2.再使用你的echo例子测试proxy_server例子,client-proxy_server出现�
��量time-wait,proxy_server-echo_server也出现了大量time-wait,echo_serv
er机子正常。

3.将client例子改为on_write直接就close连接,则client-proxy_server的t
ime-wait消失。proxy_server-echo_server则依然存在。

问题,是不是bas里面的client在on_read里主动断开,会导致出现�
��机有time-wait连接

Original issue reported on code.google.com by pk2794...@163.com on 8 Dec 2011 at 3:54

GoogleCodeExporter commented 8 years ago
按照TCP协议设计,主动关闭方会进入TIME_WAIT状态,主要是为��
�实现终止TCP全双工连接时的可靠性及允许老的重复分节在网�
��中消逝,等过了2msl(max segment 
lifetime,大约1~4分钟)后TIME_WAIT就会消失,这是TCP固有的。
请进一步参考相关资料。

Original comment by moore...@gmail.com on 8 Dec 2011 at 1:03