At 10:20 AM 9/7/2001 -0700, John Reese wrote:
> > If you're sending a large or slow document, is there any way to detect
> > that the browser on the other side has aborted the download
> > prematurely, as soon as it happens? I.e. you're streaming a 1.7
> > zillobyte file, user hits escape after 10 bytes, can you abort the
> > send to save on resources?
>It's possible to detect this condition in
>-- EPIPE is thrown by the socket.send. It's currently caught and
>ignored. Could this information be returned, or stored in
>HTTPResponse state, or something?
Here's an idea: You could have it raise an exception on EPIPE, which would
automatically end the servlet's processing without needing extra code to
check for that case. Then the catch-all exception handler could
specifically not bother logging an error if it catches that exception. In
the case where your servlet needs to do some special processing on a broken
socket, it could catch the exception and do its own special processing.