当我从Windows7 / Vista向Linux Red Hat 4发送HTTPS请求时,'netstat -an'命令显示 'FIN_WAIT1'或'SYNC_RECV'状态。
任何人都可以帮助我为什么会出现这些状态而不是ESTABLISHED?
答案 0 :(得分:3)
TCP连接正在关闭,请参阅http://www.freesoft.org/CIE/Course/Section4/11.htm
答案 1 :(得分:0)
FIN_WAIT1是什么意思?: TCP连接正在关闭
我有一个Python示例显示流程:
>>> import sys, socket
>>> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> sock.bind(('172.31.35.6', 6677))
>>> sock.listen()
>>> conn, client_address = sock.accept()
>>> import sys, socket
>>> conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> conn.connect(('3.19.54.89', 6677))
root@ip-172-31-35-6:/home/ubuntu# netstat | grep 6677
tcp 0 0 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:54944 ESTABLISHED
root@ip-172-31-35-6:/home/ubuntu# while true; do netstat | grep 6677; done > ~/tmp
>>> conn.close()
tcp 0 0 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 ESTABLISHED
tcp 0 0 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 ESTABLISHED
tcp 0 1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1
tcp 0 1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1
tcp 0 1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1
tcp 0 1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1
tcp 0 1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1
tcp 0 1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1
tcp 0 1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1
tcp 0 1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1
tcp 0 1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1
tcp 0 1 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT1
tcp 0 0 ip-172-31-35-6.us-:6677 cpea84e3ff37803-c:55037 FIN_WAIT2