I implement events sent by the server using the servlet 3.0 interface javax.servlet.AsyncContext .
However, I cannot figure out how I should handle I / O errors, such as disabling peer-to-peer communication.
For a given AsyncContext ac = request.startAsync() I can call ac.getResponse().getWriter().print(something) and then ac.getResponse.getWriter().flush() and it works fine. However, when the client disconnects, I do not get an error - even if I attach the listener, its onError method onError not called.
I tested it with both Jetty 8 and Tomcat 7, and it seems that disconnecting from the client is not reported back to the application.
What can be done to detect a communication error?
Artyom Aug 20 '12 at 14:50 2012-08-20 14:50
source share