I have a very simple console Client Server chat going, but when I close the Client by pressing the x button, the Server still shows that the socket is open by checking socket.isConnected() and if(in == null), neither one of these checks work after I close the client window with x. Anyone have any tips for this?
I have also tried setting the socket.keepAlive(true) and sending a message to the client, but after client closes, I still dont have anything showing the client has closed. No exceptions thrown and no messages from my handler.
Thanks for any help provided.
Read up on the java doc and on tcp.
Unless you close the socket on iether side fin never gets send and thus you won't see anything happening on the other side, that is untill it times out.
If you wait long enough it will work. if you want immediate feedback, clean up after you. Unload/release resources, close the socket manually.