I have an application that creates a network based on user activity. The usual payload sent by the application is 100-200 bytes, so basically there are no heavy lifting tasks. These tasks usually work without any problems (statistically 99.9% or requests are fine), but in addition to these network actions, my application also sends heartbeat back to our servers (which are located on Amazon EC2 (us-east1-d, if it has the meaning)). Heartbeat is sent every 10 seconds as a regular POST request over HTTPS - and this is what actually does not work for me, because the failure rate is much higher than what is observed during normal network activity. During my last 7-hour test, 25% of heart rhythm requests failed (but I saw even 35% of the drops), and it usually holds at that speed. When I disable SSL, the error rate remains on my test device at 8%. This would probably not be a big problem if these failures fell into any pattern (i.e., every fourth, etc., which could mean some filtering based on speed, or fail close to every hour or day , which could mean that the request cap is set somewhere). But nothing like this happens - sometimes a 10-15 request can fail in a row, and this is bad for a heartbeat. In addition, to make things worse, at the moment I see unsuccessful requests, I can connect to the server from the same device, and this works without problems). This issue occurs in any supported version of Android (2.2+).
I use the recent httpclientandroidlib to execute HTTP requests, so I started to suspect that lib was the culprit, so I switched to Android Asynchronous HTTP Client , but that did not give any changes. Basically I get exceptions:
NoHttpResponseException: The destination server was unable to respond. destination server failed to respond to URL: https: //xx.xx.xx.xx/heartbeat/
and for SSL enabled connections:
javax.net.ssl.SSLException: Read error: ssl = 0x784bc588: input / output error during a system call, connection reset by peer Read error: ssl = 0x784bc588: input / output error during a system call, connection reset from user URL: https: //xx.xx.xx.xx/heartbeat/
Basically, I would like to first trace the culprit, so knowing that the application works mainly on mobile networks, I am open to any suggestion on how to continue working with this problem, as I am stuck at the moment.