Technicaly it's not really posiible as the server cannot initiate any communication with the client - this is due to the asymmetric nature of the HTTP protocol.
However just because its not technally possible doesn't mean it can't be done, it just need to be done sneakily ;p What you could do is have a hidden frame or iframe on your client that has some nice javascript in it that continuously calls the server at regular shortish (say 10 secs) intervals and hits a servet which keeps a record of thier last hit in some application wide bean. Then before beggining this task (and perhaps during it) you can check this bean and if thier last update was older than 20 seconds, assume they have disconnected. Cheers Adrian > -----Original Message----- > From: steve martin [SMTP:[EMAIL PROTECTED]] > Sent: 03 July 2002 03:32 > To: [EMAIL PROTECTED] > Subject: how to check if client still connected? > > Hi, > Does anyone know how to check if the client browser > still connected before performing a time-consuming > task? > > thanks, > s.m. > > __________________________________________________ > Do You Yahoo!? > Sign up for SBC Yahoo! Dial - First Month Free > http://sbc.yahoo.com > > __________________________________________________________________________ > _ > 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 -- It is the strict policy of Truworths that its e-mail facility and all e-mail communications emanating therefrom, should be utilised for business purposes only and should conform to high professional and business standards. Truworths has stipulated certain regulations in terms whereof strict guidelines relating to the use and content of e-mail communications are laid down. The use of the Truworths e-mail facility is not permitted for the distribution of chain letters or offensive mail of any nature whatsoever. Truworths hereby distances itself from and accepts no liability in respect of the unauthorised use of its e-mail facility or the sending of e-mail communications for other than strictly business purposes. Truworths furthermore disclaims liability for any unauthorised instruction for which permission was not granted. Truworths Limited accepts no liability for any consequences arising from or as a result of reliance on this message unless it is in respect of bona fide Truworths business for which proper authorisation has been granted. Any recipient of an unacceptable communication, a chain letter or offensive material of any nature is requested to notify the Truworths e-mail administrator ([EMAIL PROTECTED]) immediately in order that appropriate action can be taken against the individual concerned. ___________________________________________________________________________ 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