title: Socket writing errors
body: <p>I'm new to Android Java, but I'm trying to build an application that backups a file to my computer from my android phone through the internet.</p>
  
  <p>I've got a problem with writing a socket, the Socket looks like this:</p>
  
  <pre><code>mySock = new Socket("127.0.0.1", 8001);
  </code></pre>
  
  <p>This server runs on my computer, when opening on browser (on the computer) it shows my Desktop.</p>
  
  <p>I am using a real phone, not the emulator</p>
  
  <p>yes, I have INTERNET permission, and I have already tried "10.0.2.2" but it didn't seem to work as well, I always got the message on my LogCat that says</p>
  
  <pre><code>failed to connect to /127.0.0.1 (port 8001):
  connect failed: ECONNREFUSED (connection refused)
  </code></pre>
  
  <p>when putting a breakpoint on the line of the socket and debugging, when getting to the socket writing line, it seem to have a problem writing the Socket, did I write it wrong in some way? I know the parameters are fine, please help!</p>
  
  <p>Edit:
  So now I disabled the firewall on the Ubuntu, and when I put the Ip 10.0.2.2 it actually stops to... I guess to try and copy? after a few seconds it prints the next message:</p>
  
  <pre><code>connect failed: EHOSTUNREACH (No route to host)
  </code></pre>
  
  <p>someone knows what might be the problem now?</p>