Hi,

I've seen various discussions here and on the web but I haven't found a 
conclusive answer. Why does an AsyncListener not receive onError notifications 
when a client disconnects? The scenario is that async processing starts (via 
request.startAsync), the Servlet container thread is exited, and then at some 
point before the async request completes, the client goes away (e.g. browser 
tab is closed). The only way I've found to detect the client has gone away is 
to write to and flush the servlet response buffer.

To my knowledge there is nothing inherent in NIO and TCP that prevents the 
server from detecting that the client has disconnected. The WebSocket 
implementation detects disconnected clients immediately and other HTTP servers 
(e.g. node) seem to be able to do this. What is it about the Servlet async 
support that prevents it from knowing when a client has disconnected?

Thanks,
Rossen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to