Java.net.SocketException: sendto failed: EPIPE (Broken pipe) through data connection on localhost

In my Android app, I want to read an audio stream and analyze its screaming metadata. I worked using StreamProxy, as in the NPR project: http://code.google.com/p/npr-android-app/source/browse/Npr/src/org/npr/android/news/StreamProxy.java?r = e4984187f45c39a54ea6c88f71197762dbe10e72

The problem is that it does not work through a data connection. A similar problem has NPR.

To summarize, this proxy acts as a local web server, creating an interface between the application and the remote stream. It runs on localhost 127.0.0.1 with the custom port created. When the server reads the stream data, it copies it to the application, as you can read on line 223 in StreamProxy :

client.getOutputStream().write(buff, 0, readBytes); 

However, this line throws this exception on the data link:

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

I am not an expert in sockets and threads. I do not understand what makes the difference between Wi-Fi and data connection in this case.

+8
android localhost streaming socketexception
source share
1 answer

Below are some solutions!

First, make sure your client has the same version as the server you are trying to join. If you do not have the same version, you can download MCNostalgia and use it to downgrade your client.

Update Java

If you do not want to have any incompatibility issues, I would advise you to install the latest Java runtime ( jre 7.0_05 ). Before doing this, it is recommended that you uninstall other previous versions. If your operating system runs in 32bit , then install the 32bit ( x86 ) version. If you have 64bit , set both to 64bit and then 32bit in that exact order.

Disable unnecessary network hosts

Hamachi and Virtual Box may be one of them. They may slow down or interfere with your connection. Enter the network control panel and click " modify network cards " (or something similar). Right click on which host you need to disconnect and then just disconnect.

Disable the firewall

You can access the firewall settings in the control panel and disable it there. If this does not work, you can also try disabling the router's firewall. If these attempts do not work, disable the antivirus (these settings are not recommended, since hackers can easily penetrate your computer).

This also works for:

 > Internal exception: java.net.SocketException: Software caused > connection abort: socket write error 
-one
source share

All Articles