title: Can't resolve IP address to hostname
body: <p>I was originally running a server from the Java main method for an Android application but was forced to instead run it through a Android main activity due to Android Studio. Upon trying to run it from the main activity I have run into issues with it binding to the specified port. When I try to connect with my Client (which I know works fine) it returns connection refused errors that indicate to me that my server isn't actually listening in on the specified port. Here is my server and main activity. I believe there must be some small issue with my syntax in setting it all up.</p>
  
  <pre><code>public class Server extends Thread {
  ServerSocket serverSocket = null;
  final Reactor reactor = new Reactor();
  int port;
  boolean running;
  
  Server(int p) throws  IOException {
      running = true;
      port = p;
  }
  
  
  @Override
  public void run() {
      try {
          serverSocket = new ServerSocket(port);
      } catch (IOException e) {
          e.printStackTrace();
      }
      while (running == true) {
  
          try {
  
              System.out.println("Connecting");
              System.out.println("Server running on port: " + port);
  
              Socket listener = serverSocket.accept();
  
  
          } catch (IOException e) {
              e.printStackTrace();
              running = false;
          }
      }
  }
  }
  </code></pre>
  
  <p>Here is my mainActivity that is meant to just start the Server thread that listens on the specified port </p>
  
  <pre><code>public class MainActivity extends ActionBarActivity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      Server server = null;
      try {
          server = new Server(4600);
      } catch (IOException e) {
          e.printStackTrace();
      }
      server.start();
  
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.menu_main, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      int id = item.getItemId();
  
      //noinspection SimplifiableIfStatement
      if (id == R.id.action_settings) {
          return true;
      }
  
      return super.onOptionsItemSelected(item);
  }
  }
  </code></pre>
  
  <p>Here is the stack trace from the client side </p>
  
  <pre><code>  02-14 17:42:56.109    1314-1364/edu.carleton.l8client W/System.err﹕    j       java.net.UnknownHostException: Unable to resolve host "172.17.201.280": No address associated with hostname
   02-14 17:42:56.109    1314-1364/edu.carleton.l8client W/System.err﹕ at     java.net.InetAddress.lookupHostByName(InetAddress.java:424)
   02-14 17:42:56.117    1314-1364/edu.carleton.l8client W/System.err﹕ at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
   02-14 17:42:56.117    1314-1364/edu.carleton.l8client W/System.err﹕ at java.net.InetAddress.getAllByName(InetAddress.java:214)
  02-14 17:42:56.117    1314-1364/edu.carleton.l8client W/System.err﹕ at java.net.Socket.tryAllAddresses(Socket.java:108)
   02-14 17:42:56.117    1314-1364/edu.carleton.l8client W/System.err﹕ at java.net.Socket.&lt;init&gt;(Socket.java:177)
   02-14 17:42:56.127    1314-1364/edu.carleton.l8client W/System.err﹕ at java.net.Socket.&lt;init&gt;(Socket.java:149)
    02-14 17:42:56.127    1314-1364/edu.carleton.l8client W/System.err﹕ at edu.carleton.l8client.Client.run(Client.java:99)
    02-14 17:42:56.127    1314-1364/edu.carleton.l8client W/System.err﹕ Caused by: libcore.io.GaiException: getaddrinfo failed: EAI_NODATA (No address associated with hostname)
    02-14 17:42:56.137    1314-1364/edu.carleton.l8client W/System.err﹕ at libcore.io.Posix.getaddrinfo(Native Method)
    02-14 17:42:56.137    1314-1364/edu.carleton.l8client W/System.err﹕ at libcore.io.ForwardingOs.getaddrinfo(ForwardingOs.java:55)
     02-14 17:42:56.147    1314-1364/edu.carleton.l8client W/System.err﹕ at java.net.InetAddress.lookupHostByName(InetAddress.java:405)
  </code></pre>