David Mossakowski <[EMAIL PROTECTED]> writes: > This being the case I have a couple of questions: > > 1. While sending the response to client if the browser threw out the > connection does the servlet get an IOException?
Yes. Well, it actually gets an exception from the Socket object but it's a sub-class of IOException. > If so does it just ignore it and throw out the thread serving that > request? Could this be the reason for ugly broken pipe errors in > Apache logs? You've got it. If the TCP con goes away then you'll get the IO excep when you try to do something (most commonly write to the servlet output stream). If you don't handle that IOException then it percolates to the servlet container which will log it as a pipe error. > 2. Expanding on the previous point I have a servlet that writes bytes > to the output stream gotten from the HTTPServletResponse but have > noticed that a closed browser session is not always detected by the > servlet. Do you mean session? Or do you mean connection. I think you mean connection. > It takes a number of bytes to finally detect the socket as > being closed because I presume the output is buffered. What controls > the buffer length? API. Check the class documentation and you'll see that there is discussion of that. > On the other hand when there isn't any data being sent to the > socket but it has been closed by the browser I would assume > that there is a timeout set on it so that it is closed but who sets > it? Timeout on the socket (SO_TIMEOUT) is set by the container. Some containers allow you to configure it but others don't. Nic ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
