I have the following code:
public void disconnect()
{
running = false;
if(thread != null)
thread.interrupt();
thread = null;
try
{
socket.close();
}catch(Exception e){e.printStackTrace();}
}
I have a BufferedReader that collects the input from the stream and a PrintWriter that sends messages through the output stream. Should the BufferedReader and the PrintWriter be closed before i close the socket? Is it bad to leave the i/o streams open?
According to the Java Networking Tutorial