简体   繁体   English

Android-客户端导致“对等连接重置”异常

[英]Android - client causing “Connection reset by peer” exception

I would like to know, whether there is a possibility that the implementation of the client side, could be causing this IOException? 我想知道,客户端的实现是否有可能导致此IOException? As far as I know, this exception is caused by the remote site, sending the RST packet, effectively shutting down the connection. 据我所知,此异常是由远程站点发送RST数据包引起的,实际上是关闭了连接。 Whatever answers I have come up with so far, all claim that this is the server's fault. 到目前为止,无论我提出什么答案,都声称这是服务器的错误。

But the problem is the following. 但是问题是以下。 I am communicating with the server via TCP sockets and the android app is the client. 我正在通过TCP套接字与服务器通信,而android app是客户端。 The communication used to work prefectly, but after making some modifications (to the client side ONLY), I keep getting this exception. 通讯过去可以很好地工作,但是在进行了一些修改(仅限客户端)之后,我不断收到此异常。

I am having a hard time pinpointing the source of the problem, because the updates I've made had nothing to do with the communication implementation. 我很难确定问题的根源,因为我所做的更新与通信实现无关。 I've only added another query for the server to handle. 我只为服务器处理添加了另一个查询。

Is it possible to produce this exception from the client side(that my code, could cause the remote side to produce this outcome)? 是否有可能从客户端生成此异常(我的代码可能导致远程生成此结果)? Perhaps by overloading the server with requests? 也许通过服务器超载请求? Or maybe Android is closing my sockets, by itself? 还是Android本身正在关闭我的套接字? Or perhaps I am somehow closing the sockets, but that would probably produce a different type of exception. 或者,也许我以某种方式关闭了套接字,但这可能会产生不同类型的异常。

Any advice on the matter would be very much appreciated. 对此事的任何建议将不胜感激。

As it turns out, the problem wasn't in the client implementation afterall. 事实证明,问题根本不在客户端实现中。 The server was actually ending the connection, after a certain query had been executed. 执行某些查询后,服务器实际上正在终止连接。 To anyone who may be experiencing a similar issue (where you think the client side has an error, despite the obvious fact stated by the program, that it's the server's fault), I suggest you double check the server for possible timeouts and such. 对于可能遇到类似问题的人(尽管程序指出了明显的事实,但您认为客户端有错误,这是服务器的错误),我建议您仔细检查服务器是否存在超时等问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android URLConnection read()异常-对等重置 - Android URLConnection read() Exception-Connection Reset by Peer 通过对等方重置Android到WCF的连接 - Android to WCF connection reset by peer 客户端关闭连接时,Netty 偶尔会产生“Connection reset by peer”异常 - Netty occasionally generates "Connection reset by peer" exception when client close connection 通过异步http客户端和netty的同级重置连接 - Connection reset by peer with async http client and netty 在FTP客户端中处理“对等连接重置”错误 - Handling “Connection reset by peer” error in an FTP client 通过对等异常重置连接(toplink) - getting Connection reset by peer exception (toplink) Android mediaPlayer 渐进式下载“对等方重置连接” - Android mediaPlayer Progressive Download "Connection Reset By Peer" 服务器端处理丢失的客户端连接(由对等方重置)? - Server-side handling missing client connection (reset by peer)? java异常:对等连接重置:套接字写入错误 - java Exception: connection reset by peer: socket write error Neo4j Java 驱动程序抛出“对等方重置连接”异常 - Neo4j Java driver throws "connection reset by peer" exception
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM