title: How to use PORT command while writing an FTP client with JAVA
body: <p>I am trying to write an FTP client using java.</p>
  
  <p>As far as I understand I need to send my IP adress with PORT command when I need to establish an active connection but,
  How do I get that IP address?</p>
  
  <p>I am trying to do something like this but it is obviously wrong:</p>
  
  <pre><code>ServerSocket ssock = new ServerSocket();
  ssock.bind(null);
  ssock.ssock.getLocalPort();
  ssock.getInetAddress();
  </code></pre>
  
  <p>Last line returns null.</p>
  
  <p>So again how can I send my IP address and port to server?</p>
  
  <p>Thank you.</p>