“Connection reset by peer”代表什么?
“Connection reset by peer”表示當前服務器接受到了通信對端發送的TCP RST信號,即通信對端已經關閉了連接,通過RST信號希望接收方關閉連接。
The remote server has sent you a RST packet, which indicates an immediate dropping of the connection, rather than the usual handshake. This bypasses the normal half-closed state transition.
產生RST場景或者導致“Connection reset by peer”場景?
1.當嘗試和未開放的服務器端口建立tcp連接時,服務器tcp將會直接向客戶端發送reset報文;
2.雙方之前已經正常建立了通信通道,也可能進行過了交互,當某一方在交互的過程中發生了異常,如崩潰等,異常的一方會向對端發送reset報文,通知對方將連接關閉;
3.當收到TCP報文,但是發現該報文不是已建立的TCP連接列表可處理的,則其直接向對端發送reset報文;
4.ack報文丟失,並且超出一定的重傳次數或時間后,會主動向對端發送reset報文釋放該TCP連接;
參考:
https://stackoverflow.com/questions/1434451/what-does-connection-reset-by-peer-mean;
http://lovestblog.cn/blog/2014/05/20/tcp-broken-pipe/;