java - Detecting client disconnect in tomcat servlet? -
how can detect client side of tomcat servlet request has disconnected? i've read should response.getoutputstream().print(), response.getoutputstream().flush() , catch ioexception, there way can detect without writing data?
edit:
the servlet sends out data stream doesn't end, doesn't have data flowing through (it's stream of real time events). need detect when client disconnects because have cleanup have @ point (resources release, etcetera). if have httpservletrequest available, trying read throw ioexception if client disconnects?
is there way can detect without writing data?
no because there isn't way in tcp/ip detect without writing data.
don't worry it. complete request actions , write response. if client has disappeared, cause ioexception: connection reset, thrown servlet container. nothing have that.
Comments
Post a Comment