title: getLocalAddress() returning 0.0.0.0
body: <p>I am trying to write a program using Sockets and I need to get my own local IP address.</p>
  
  <p>When I use getLocalAddress in the socket, I only get 0.0.0.0.</p>
  
  <p>Here is a little piece of my code:</p>
  
  <pre><code>DatagramSocket socket;
  DatagramPacket pacoteEnvio = new DatagramPacket(msgByte, msgByte.length, addr, 6500);
  socket = new DatagramSocket();
  System.out.println("Local address = " + socket.getLocalAddress());
  socket.send(pacoteEnvio);
  </code></pre>
  
  <p>Do you have any idea?</p>
  
  <p>I am using UDP, so I am not sure if I can get my IP this way because it's connectionless, but I think you can help me!</p>