“软件导致连接中止:套接字写入错误"的官方原因 [英] Official reasons for "Software caused connection abort: socket write error"

查看:41
本文介绍了“软件导致连接中止:套接字写入错误"的官方原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

鉴于此堆栈跟踪代码段

引起:java.net.SocketException:软件导致连接中止:套接字写入错误
 atjava.net.SocketOutputStream.socketWrite0(本机方法)

Caused by: java.net.SocketException: Software caused connection abort: socket write error
 at java.net.SocketOutputStream.socketWrite0(Native Method)

我试图回答以下问题:

  1. 什么代码抛出了这个异常?(JVM?/Tomcat?/我的代码?)
  2. 是什么导致抛出此异常?

关于#1:

Sun 的 JVM 源不包含这个确切的消息,但我认为文本软件导致连接中止:套接字写入错误来自 SocketOutputStream 的本机实现:

Sun's JVM source doesn't contain this exact message, but I think the text Software caused connection abort: socket write error is from the native implementation of SocketOutputStream:

private native void socketWrite0(FileDescriptor fd, byte[] b, int off,
                 int len) throws IOException;

关于#2

我的猜测是客户端在获得完整响应之前终止了连接(例如发送了一个请求,但在获得完整响应之前,它被关闭/终止/离线)

My guess is that it is caused when the client has terminated the connection, before getting the full response (e.g. sent a request, but before getting the full response, it got closed / terminated / offline)

问题:

  1. 上述假设是否正确(#1 和 #2)?
  2. 这是否与以下情况不同:由于服务器端的网络错误,无法写入客户端"?还是会呈现相同的错误消息?
  3. 最重要的是:是否有官方文件(例如来自 Sun)说明上述内容?
  1. Are the above assumptions correct (#1 and #2)?
  2. Can this be diffrentiated from the situation: "could not write to the client, due to a network error on the server side"? or would that render the same error message?
  3. And most important: Is there an official document (e.g from Sun) stating the above?

我需要证明这个堆栈跟踪是套接字客户端的错误",并且服务器无法避免它.(除了捕获异常,或使用非 Sun JVM SocketOutputStream,尽管两者都没有真正避免客户端已终止的事实)

I need to have a proof that this stack trace is the socket client's "fault", and there is nothing that the server could have done to avoid it. (except catching the exception, or using a non Sun JVM SocketOutputStream, though both don't really avoid the fact the client has terminated)

推荐答案

当本地网络系统中止一个连接,例如当 WinSock 关闭已建立的连接时数据重传失败后(接收者从不确认发送的数据在数据流套接字上).

This error can occur when the local network system aborts a connection, such as when WinSock closes an established connection after data retransmission fails (receiver never acknowledges data sent on a datastream socket).

请参阅这篇 MSDN 文章.另请参阅有关软件导致连接中止"的一些信息.

这篇关于“软件导致连接中止:套接字写入错误"的官方原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆