title: Detect client disconnect in Server Sent Events in Java
body: <p>I have SSE rest application, and am using <code>PrintWriter</code> to flush the data to the client. I do use <code>PrintWriter checkError()</code> method to determine client is available or not, but it does not report error when client connection (Wi-Fi) goes away, and still thinks client is still connected.</p>
  
  <p>Is there a way in Server Sent Events using Java API which I could leverage to figure out client has been disconnected in case of Half open connections, so that I could close that streaming channel.</p>