java udp client couldnt receive packet send by server
<p>from java udp programming every thing is working fine,except the server responding to the client is not detected.i.e sending data to server is ok, server received data and respond back to the client.The problem is the data not receiving to client.
My local port used is 501
server listening port is 500, and i send data to 500 to server and wait the connection at 501 at client. The code can illustrate this:
this is the recieving thread.. Dont know where goes wrong!  Note i am useing the online server.</p>

<pre><code>String myipAddress = "10.100.69.174";
String SendingIp = "108.163.180.54";
String sendinPort = "500";
String myRecievePortNo="501";

public void run() 
    {
        try {

             recievingSocket = new DatagramSocket(Integer.parseInt(myRecievePortNo), InetAddress.getByName(myipAddress));
            while (true) 
            {

                byte[] data = new byte[1024];
                DatagramPacket recievingPacket = new DatagramPacket(data, data.length);
                recievingSocket.receive(recievingPacket);
                String mydata = new String(data, 0, data.length);
                 System.out.printf("Hello recieve"+mydata);
                }
            }
        } 
        catch (Exception EX) 
        {
            JOptionPane.showMessageDialog(null, "Error Message" + EX, "Error", JOptionPane.ERROR_MESSAGE);
        }

    }






//this section is call when user click the send button
public void sendData(String toServer) {
    try
    {
        DatagramSocket sendingSocket = new DatagramSocket(Integer.parseInt(myRecievePortNo));
        byte[] data = toServer.getBytes();
        DatagramPacket sendingPacket = new DatagramPacket(data, data.length, InetAddress.getByName(SendingIp), Integer.parseInt(sendinPort));
        sendingSocket.send(sendingPacket);
        sendingSocket.close();
    }
    catch (Exception EX) 
    {
        JOptionPane.showMessageDialog(null, "Sending Error :" + EX, "Error", JOptionPane.ERROR_MESSAGE);
    }


}
</code></pre>
