title: getHostAddress() and getInetAddress() in Java
body: <p>I am creating TCP socket application. In server side, </p>
  
  <pre><code>ss = new ServerSocket(10000);
  Socket socket = ss.accept();
  String remoteIp = socket.getInetAddress().getHostAddress();
  String RemotePort = ":"+socket.getLocalPort();
  </code></pre>
  
  <p>I am a little bit confused about the last two lines, getInetAddress() used to return the address of socket connect to, namely is the address of host? and then why we need a getHostAddress()? </p>