Due to operating system buffering issues and the well understood edge conditions in 
TCP/IP protocol you will not be able to reliably detect stop (tcp/ip fin).  
For example, you can write a block of data to a client and close the connection 
thinking everything is okay...in reality the bytes haven't left the local host.....but 
the peer has already sent FIN.
-phil ([EMAIL PROTECTED])
Phillip A. Lindsay
eBuilt, Inc. 

> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 24, 1999 10:13 AM
> To: [EMAIL PROTECTED]
> Subject: Re: somebody clicks stop button on browser
> 
> 
> akashmaheshwari wrote:
> >
> > Hi all,
> >         i am wondering how do i know that some body had
> >         clicked stop button on browser.
> >         Actually as soon as sombody clicks stop button the
> >         thread in the servlet stop executing .
> >         in my service method of servlet i setting a flag.
> >         i want to do flag = false when sombody clicks the
> >         stop button or when service method is over.
> >         any clue please
> 
> The short answer is you can't. The slightly longer answer is that 
> the browser
> does not send any request to the server when the user clicks 
> stop. So, your
> servlet is not notified at all when this occurs. However, when 
> the user clicks
> the stop button, an exception will be thrown when your servlet 
> attempts to write
> to the output stream. You can catch the exception and deal with it at that
> point. The exception that is thrown is an "IOException: Broken Pipe."
> 
> Kevin Mukhar
> 
> __________________________________________________________________
> _________
> 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
> 
BEGIN:VCARD
VERSION:2.1
N:Lindsay;Phillip;A.
FN:Phillip A. Lindsay
ORG:eBuilt, Inc.
TITLE:V.P. of R&D
TEL;WORK;VOICE:(949) 253-5860 X 145
TEL;HOME;VOICE:(714) 280-9571
TEL;CELL;VOICE:(714) 926-9790
TEL;WORK;FAX:(949) 253-5861
URL:
URL:http://www.ebuilt.net
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:19990826T162408Z
END:VCARD

Reply via email to