tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronald Klop <>
Subject Re: Urgent: how to detect client has closed connection
Date Wed, 01 Jun 2005 12:14:08 GMT
What Writer are you using? If you do response.getWriter() you will get a PrintWriter and the
docs tell you that PrintWriter doesn't throw exceptions, so your app keeps printing to the
writer after an error. (A closed connection is an IOException.)
If you use the default out property of a jsp page you get a JspWriter which does throw exeptions
on error.


On Tue May 31 19:42:30 CEST 2005 Tomcat Users List <>
> Hey guys,
> I have a problem right now. I wrote a Jsp page to keep sending data to 
> client browser. However, no exception was thrown when I use out.print() to 
> send something to client even after client has closed his web browser. My 
> question is how can i know his browser is closed, so I can stop sending.
> Also, from the tomcat logs, the "reset by peer" socket exception was thrown 
> by Tomcat. however, seems i don't have a way to catch it.
> Can anybody help me with this one... I will be really thankful to any help 
> from you.
> Thanks,
> Luke
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today it's FREE! 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message