title: I can ping my localhost but I can't with other IP address
body: <p>I have here a UDP ping client. I don't know if I did it right but I think it works if I set <code>127.0.0.1</code> as the IP address. But it won't if I set it to, for instance, the IP address of Google. I get an exception: <code> java.net.SocketTimeoutException: Receive timed out </code>.</p>
  
  <pre><code>import java.io.*;
  import java.net.*;
  import java.util.*;
  
  public class PingClient {
  
      private static final int AVERAGE_DELAY = 0;
      public static void main(String[] args) throws Exception    {
          int port = 4997;
          DatagramSocket socket = new DatagramSocket(port);
  
          for(int i=1;i&lt;=10;i++) {
              byte[] buf = new byte[1024] ;
              Calendar cal=Calendar.getInstance();
              String ping="PING "+ i +" "+cal.getTimeInMillis()+" ms"+"\r\n";
              buf=ping.getBytes("UTF-8");
              InetAddress address = InetAddress.getByName("69.63.176.11");
              DatagramPacket packet = new DatagramPacket(buf, buf.length, address, port);
              packet.setData(buf);
              socket.send(packet);
              Thread.sleep( 10* AVERAGE_DELAY);
              DatagramPacket server_response = new DatagramPacket(new byte[1024], 1024);
              socket.setSoTimeout(1000);
              socket.receive(server_response);
              printData(server_response);
          }   
      }
  }
  </code></pre>
  
  <p><br></p>