java.net.SocketException:软件导致连接中止:recv失败 [英] java.net.SocketException: Software caused connection abort: recv failed

查看:2933
本文介绍了java.net.SocketException:软件导致连接中止:recv失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法找到以下错误的确切含义的充分答案:

I haven't been able to find an adequate answer to what exactly the following error means:

java.net.SocketException:Software导致连接中止:recv失败

注意:


  • 这个错误不常见且不可预测;虽然收到此错误意味着将来所有URI请求也将失败。

  • 唯一可行的解​​决方案(也是偶尔)是重启Tomcat和/或实际机器(Windows in这个案例)。

  • URI绝对可用(通过要求浏览器进行提取确认)。

相关代码:

BufferedReader reader;
try { 
 URL url = new URL(URI);
 reader = new BufferedReader(new InputStreamReader(url.openStream())));
} catch( MalformedURLException e ) { 
 throw new IOException("Expecting a well-formed URL: " + e); 
}//end try: Have a stream

String buffer;
StringBuilder result = new StringBuilder();
while( null != (buffer = reader.readLine()) ) { 
 result.append(buffer); 
}//end while: Got the contents.
reader.close();


推荐答案

这通常意味着存在网络错误,例如作为TCP超时。我首先在连接上放置一个嗅探器(wireshark),看看你是否能看到任何问题。如果存在TCP错误,您应该能够看到它。此外,如果适用,您可以检查路由器日志。如果在任何地方都涉及到无线,那么这就是造成这类错误的另一个原因。

This usually means that there was a network error, such as a TCP timeout. I would start by placing a sniffer (wireshark) on the connection to see if you can see any problems. If there is a TCP error, you should be able to see it. Also, you can check your router logs, if this is applicable. If wireless is involved anywhere, that is another source for these kind of errors.

这篇关于java.net.SocketException:软件导致连接中止:recv失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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