title: java.net.SocketException: sendto failed: EPIPE (Broken pipe) over a data connection to localhost
body: <p>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:
  <a href="http://code.google.com/p/npr-android-app/source/browse/Npr/src/org/npr/android/news/StreamProxy.java?r=e4984187f45c39a54ea6c88f71197762dbe10e72">http://code.google.com/p/npr-android-app/source/browse/Npr/src/org/npr/android/news/StreamProxy.java?r=e4984187f45c39a54ea6c88f71197762dbe10e72</a></p>
  
  <p>The problem is that it's not working over a data connection. NPR has got the same issue.</p>
  
  <p>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 <a href="http://code.google.com/p/npr-android-app/source/browse/Npr/src/org/npr/android/news/StreamProxy.java?r=e4984187f45c39a54ea6c88f71197762dbe10e72">StreamProxy</a>:</p>
  
  <pre><code>client.getOutputStream().write(buff, 0, readBytes);
  </code></pre>
  
  <p>However that line produces this exception over a data connection:</p>
  
  <pre><code>java.net.SocketException: sendto failed: EPIPE (Broken pipe)
  </code></pre>
  
  <p>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.</p>