How to send udp packets using Ip address from source to destination host?
<p>Source side:</p>

<pre><code>import java.io.*;

import java.net.*; 

class Server
{ 

 public static void main(String args[]) throws Exception 
   {

    DatagramSocket ds = new DatagramSocket(50074); 
    byte[] ms = new byte[1024]; 
    String a="Computer";
    ms=a.getBytes();
    DatagramPacket ps = new DatagramPacket(ms, ms.length, InetAddress.getByName("Destination Ip address"),1599); 
    ds.send(ps);

   }


}
</code></pre>

<p>Destination side:</p>

<pre><code>import java.io.*; 

import java.net.*; 

class Client
{ 

 public static void main(String args[]) throws Exception 
   {

   DatagramSocket ds = new DatagramSocket(1599);

   byte[] ms = new byte[10024];

   DatagramPacket ps = new DatagramPacket(ms,ms.length);

   ds.receive(ps);

   System.out.println(new String(ps.getData()));

}

}
</code></pre>

<p>This is my program, but it is not working. When I am giving Destination IP adress="localhost" it is working well. But if I replacing localhost as "Destination ip address like 117.201.12.80 " it is not working.. please help me to solve this problem</p>
