Thanks.
I found that even user click cancel in NETSCAPE. With
apache in the middle servlet will continue send the
"WHOLE" file to apache.

In IE, if user click cancel, strange thing would
happen ( both connection to tomcat directly or apache
in middle ) :

-  No exception caught in servlet 
-  But it looks like my servlet never exits the
doGet() method after clicking cancel in IE. 
-  It looks like when clicking cancel, TCP connection
still alive.
-  I put a println() in the end of the doGet() but it
never get print out. It seems servlet "BLOCKS" forever
in the out.write(int) method of the OutputStream.

Any reason cause servlet didn't exit doGet() method? I
think if doGet() didn't returns, the thread is still
running, right? resource (memory / thread) will not be
free up.

P.S.
I am using 
tomcat 3.2.1
apache 1.3.17

thanks.


--- William Kaufman <[EMAIL PROTECTED]> wrote:
> I didn't answer, because I'd hoped someone could say
> for sure.  But my own
> guesses are:
> 
> 1) The "Cancel" button in IE doesn't actually do
> anything once the data
> starts streaming.  I've suspected this was the case,
> and it sounds like
> you've got evidence.
> 
> 2) Apache is buffering the response somehow:
> directly connected to Netscape,
> you get an immediate exception when writing to a
> closed stream; but, with
> Apache in the middle, the writes don't happen
> immediately, and no exception
> is propagated to the servlet.
> 
> My only advice would be to flush your servlet output
> early and often: you
> might (or might not) get an exception immediately.
> 
>                                                     
>        -- Bill K.
> 
> 
> > -----Original Message-----
> > From: alan leung [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 03, 2001 10:43 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Servlet --> File --> Web-browser
> > 
> > 
> > can any one helps me out?
> > thanks again.
> > 
> > --- alan leung <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > > I have a servlet reads a file from
> FileInputStream
> > > and
> > > copy those bytes to ServletOutputStream and send
> > > back
> > > to web browser.
> > > 
> > > But if user click CANCEL while downloading in
> > > netscape. i will get an exception in doGet
> method.
> > > -->
> > > IOException in doGet():
> java.net.SocketException:
> > > Connection aborted by peer: socket write error
> > > 
> > > if user click CANCEL in IE (Internet Explorer).
> i
> > > didn't get any exception print out.
> > > 
> > > Both cases is browser connect to servlet engine
> > > directly (tomcat)
> > > 
> > > if browser connects to apache server --> then
> > > tomcat;
> > > no exception got caught for netscape and IE if
> user
> > > click CANCEL while download. 
> > > 
> > > What i think is clicking CANCEL while
> downloading a
> > > file would lost the TCP connection without
> ending
> > > it.
> > > which would always rise an IOException right? 
> Why
> > > if
> > > i use apache server w/ tomcat or IE connect to
> > > tomcat
> > > directly won't cause IOException in doGet()
> method?
> > > 
> > > thanks.
> > > 
> > > 
> > > 
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Auctions - buy the things you want at
> great
> > > prices
> > > http://auctions.yahoo.com/
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Auctions - buy the things you want at great
> prices
> > http://auctions.yahoo.com/
> > 



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Reply via email to