java - Is it safe to use multiple OutputStream for the same Socket? -
Is this code safe to use? I am used to create a No, it is not safe Are religious, and until all the streams / writers are not indexed, they can not interfere when they automatically flush themselves, it is quite difficult to complete normally. It happens that it is not easy to use multiple streams in the first place, you have a single pair Mr. currents must build (input and output) and should use them to the socket life. PrintWriter or a reader per socket, but now I am in a situation where I have to pass the bases in this manner, so I am asking that I Need to stop after a worry or worry about problems of memory or harm the socket in the long run?
say hello to the public static zero (socket socket) {{PrintWriter out = new print Writer (socket.getOutputStream ()); Out.println ("hello!"); Out.flush (); } Hold (Exception e) {}}
Comments
Post a Comment