开发者

Android random exceptions on HTTP calls. Why?

I'm testing my app on 3 devices so far. One device LG Optimus from Sprint never throws exceptions on https calls (maybe once in a week)

Nexus S on T-Mobile almost every hour come up with something like this:

Read error: ssl=0x3f4060: I/O error during system call, Connection reset by peer

Now I got tablet for testing (S7 slim) and it's connected via WiFi and I get errors like:

SSL shutdown failed: I/O error during system call, Broken p开发者_如何学Goipe

Do you know why those happen and is there any way to avoid them?


Rest by peer means the server is rejecting/losing your connection. The SSL failure is probably a direct result of the connection reset. My bet is that this happen when switching networks (wifi to 3G) in the middle of some long standing connection.

If possible create a connection, do any IO, and disconnect as quickly as possible. If you do need to handle long persistent connection be prepared to handle such exceptions and reconnect behind the scenes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜