In my Android app I want to read an audio stream and parse its shoutcast metadata. I got it working using a StreamProxy as in 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's not working over a data connection. NPR has got the same issue.
To sum up, this proxy is running as a local web server, making an interface between the app and the remote stream. It's running on localhost 127.0.0.1 with a generated custom port. When the server is reading the stream data, it replicates it to the app as you can read at line 223 in StreamProxy:
client.getOutputStream().write(buff, 0, readBytes);
However that line produces this exception over a data connection:
java.net.SocketException: sendto failed: EPIPE (Broken pipe)
I'm not an expert in sockets and streaming. I don't get what makes a difference between a wifi and a data connection in that case.