I am programming a client/server applicn on a single physical machine. The client sends a packet to the server for processing, with the IP addy they are both running on.
clientSocket.send(sendPacket);
Everything works fine upto this point. But I get a crash when recieving the results from the server.
clientSocket.receive(receivePacket);
This is the error displayed by the compiler:
java.net.SocketException: socket closed
at java.net.PlainDatagramSocketImpl.receive(Native Method)
at java.net.DatagramSocket.receive(DatagramSocket.java:392)
at WCclient.main(WCclient.java:106)
Exception in thread "main"
Any help on this will be highly appreciated.
clientSocket.send(sendPacket);
Everything works fine upto this point. But I get a crash when recieving the results from the server.
clientSocket.receive(receivePacket);
This is the error displayed by the compiler:
java.net.SocketException: socket closed
at java.net.PlainDatagramSocketImpl.receive(Native Method)
at java.net.DatagramSocket.receive(DatagramSocket.java:392)
at WCclient.main(WCclient.java:106)
Exception in thread "main"
Any help on this will be highly appreciated.