“连接被对等方重置”是什么意思?意思是?

发布于 2024-08-05 08:50:26 字数 54 浏览 4 评论 0原文

TCP 连接上的“连接被对等方重置”错误是什么意思?这是致命错误还是只是通知或与网络故障有关?

What is the meaning of the "connection reset by peer" error on a TCP connection? Is it a fatal error or just a notification or related to the network failure?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

他是夢罘是命 2024-08-12 08:50:26

这是致命的。远程服务器已向您发送了 RST 数据包,这表明连接立即断开,而不是通常的握手。这绕过了正常的半封闭状态转换。我喜欢这个描述

“对等方重置连接”在 TCP/IP 中相当于将电话挂回挂机状态。这比仅仅不回复、留下一个悬而未决要礼貌得多。但这并不是真正有礼貌的 TCP/IP 对话者所期望的 FIN-ACK。

It's fatal. 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. I like this description:

"Connection reset by peer" is the TCP/IP equivalent of slamming the phone back on the hook. It's more polite than merely not replying, leaving one hanging. But it's not the FIN-ACK expected of the truly polite TCP/IP converseur.

凉栀 2024-08-12 08:50:26

这意味着已收到 TCP RST 并且连接现已关闭。当数据包从连接的一端发送但另一端无法识别该连接时,就会发生这种情况;它会发回一个设置了 RST 位的数据包,以强制关闭连接。

如果另一端崩溃然后恢复,或者在有来自您的数据传输时调用套接字上的 close(),则可能会发生这种情况,并且向您表明某些数据您之前发送的邮件可能尚未收到。

这是否是一个错误取决于你;如果您发送的信息只是为了远程客户端的利益,那么任何最终数据的丢失可能并不重要。但是,您应该关闭套接字并释放与该连接关联的任何其他资源。

This means that a TCP RST was received and the connection is now closed. This occurs when a packet is sent from your end of the connection but the other end does not recognize the connection; it will send back a packet with the RST bit set in order to forcibly close the connection.

This can happen if the other side crashes and then comes back up or if it calls close() on the socket while there is data from you in transit, and is an indication to you that some of the data that you previously sent may not have been received.

It is up to you whether that is an error; if the information you were sending was only for the benefit of the remote client then it may not matter that any final data may have been lost. However you should close the socket and free up any other resources associated with the connection.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文