Forums Register Login

confused on why socket is closed

+Pie Number of slices to send: Send
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.
Where does a nanny get ground to air missles? Protect this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 866 times.
Similar Threads
Closing sockets
EJB listening on a client socket for callbacks
To get the details of client while sending a packet if it is closed or open?
How Do You Determine a Closed Socket?
Doubt in ServerSocket and Socket
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:53:47.