服务端和客户端 出现time_wait

服务端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:\Users\TLCB>netstat -na | findstr 8080
  TCP    192.168.137.1:51108    192.168.137.2:8080     ESTABLISHED

C:\Users\TLCB>netstat -na | findstr 8080

C:\Users\TLCB>



客户端time_wait:

关闭dos telnet窗口:

C:\Users\TLCB>netstat -na | findstr 8080
  TCP    192.168.137.1:51323    192.168.137.2:8080     TIME_WAIT

C:\Users\TLCB>


服务端:
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
发布了3776 篇原创文章 · 获赞 113 · 访问量 349万+

猜你喜欢

转载自blog.csdn.net/zhaoyangjian724/article/details/104404932