Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
354 views
in Technique[技术] by (71.8m points)

java - Intermittent Connection Reset by Peer errors in Android connecting to .NET REST endpoint

I'm getting intermittent errors from devices connecting to my IIS REST service via SSL. My app works just fine, but sometimes I get this exception. It is handled properly and does not bring down app..

ut I wonder what does it mean and if there any way to fix it? Currently it causes delays in data retreived. Also, it floods logs and I can't really ignore it.. I wonder if I can better this situation.

Is this something I should expect when I deal with REST services? My server is on Amazon EC2.

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

javax.net.ssl.SSLException: Read error: ssl=0x1211a88: I/O error during system call, Connection reset by peer at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read(Native Method) at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:671) at libcore.io.Streams.readSingleByte(Streams.java:41) at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:655) at libcore.io.Streams.readAsciiLine(Streams.java:201) at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:544) at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:784) at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274) at libcore.net.http.HttpURLConnectionImpl.getResponseMessage(HttpURLConnectionImpl.java:475) at libcore.net.http.HttpsURLConnectionImpl.getResponseMessage

This is NOT something I can reproduce. Not permissions or onaything like this. This is intermittent problem. I see about 1000 of those every day from 200 devices connecting every minute.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It seems like a timeout issue occurring on the client side causing for this exception on your server side. I've seen this happening on an upload method I have on my service, since it takes sometime to upload the file the chances the mobile will move between networks are quite high and that might cause this issue.

I would examine the following solutions:

  1. Try and figure if its a certain mobile device manufacturer that causes your logs to flood with those exceptions. I've experienced cases where the manufacturer network handling was behaving differently from other brands. In case you do find that there is a specific brand causing this you might extend the default timeout on that specific device or further investigate and try to reproduce on that device.
  2. I would also examine if the clients causing those exceptions are timed out because of a latency issue for that specific called method. maybe certain customers are experiencing a certain performance issue while calling a certain method. If it is a performance issue you probably going to fix it on the server side and there is no use of investigating the client side.

Please update if you have any further details.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...