服务端time_wait:
模拟直接掐掉程序:
node1:/root/test#python test.py
server listening8080...
<socket._socketobject object at 0x7f5f1cd90a60>
('192.168.137.1', 51108)
接到来自192.168.137.1的链接
^CTraceback (most recent call last):
File "test.py", line 17, in <module>
msg = conn.recv(BUFSIZE) #接受消息的内容
KeyboardInterrupt
2020年 02月 20日 星期四 03:04:59 CST
tcp 0 0 192.168.137.2:8080 192.168.137.1:51108 TIME_WAIT
2020年 02月 20日 星期四 03:05:00 CST
tcp 0 0 192.168.137.2:8080 192.168.137.1:51108 TIME_WAIT
客户端情况:
C:UsersTLCB>netstat -na | findstr 8080
TCP 192.168.137.1:51108 192.168.137.2:8080 ESTABLISHED
C:UsersTLCB>netstat -na | findstr 8080
C:UsersTLCB>
客户端time_wait:
关闭dos telnet窗口:
C:UsersTLCB>netstat -na | findstr 8080
TCP 192.168.137.1:51323 192.168.137.2:8080 TIME_WAIT
C:UsersTLCB>
服务端:
2020年 02月 20日 星期四 03:07:07 CST
tcp 0 0 192.168.137.2:8080 0.0.0.0:* LISTEN
2020年 02月 20日 星期四 03:07:08 CST
tcp 0 0 192.168.137.2:8080 0.0.0.0:* LISTEN
^C