title: How could I know the status of the socket connection inside a PrintWriter
body: <p>I use </p>
  
  <pre><code>PrintWriter output = new PrintWriter(socket.getOutputStream(), true);
  
  ......
  output.println(message);
  ......
  </code></pre>
  
  <p>Since the println function doesn't has return value, it don't throw any exception either.
  How could I know the disconnection is cut off?</p>
  
  <p>Thanks</p>