cs.getOutputStream() called 2 times or more
Posted on 2006-05-01
Assume I have server S, client C. These following code is executed in server:
ServerSocket ss = new ServerSocket(1234);
Socket cs = ss.accept();
PrintWriter out1 = new PrintWriter(cs.getOutputStream(),true);
PrintWriter out2 = new PrintWriter(cs.getOutputStream(),true);
My question is, is out1 = out2. For example, when I run out2.close(), is out1 closed?
And a small question, when the application exits without calling out1.close() before, is out1 closed automatically when the application exited?