Does closing the BufferedReader/PrintWriter close the socket connection?

后端 未结 4 1163
耶瑟儿~
耶瑟儿~ 2020-12-10 03:03

I have an application that uses simple sockets to pass some characters between two systems. I have my java application running as a server. I establish a connection fine,

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-10 03:39

    Yes, closing any Writer/Reader will close all other Writers and Readers that they wrap. Don't close it until you are ready to close the underlying socket.

提交回复
热议问题