Android : Socket - java.net.SocketException: sendto failed: EPIPE (Broken pipe)

My two cents: we had the same issue (BROKEN EPIPE), and looking through Fiddler (or Charls, or WireShark, or other proxy debugger / listener / etc) we've noticed that no request gets sent out at all.

The reason was that we added "Content-Length" header with the wrong value.


The peer closed the connection while you were writing to it. That usually means you sent it something it didn't understand. Is it perhaps an HTTP server? Or some other protocol that you haven't implemented in your client code?