Hi, 1. sessionDestroyed is called when the server session terminates either by timeout or by terminate() method on session. In case, browser is closed, no other browser instance can be created anywhere in the world with the same session id as the one that got closed. Hence, the session responsible for the browser that got closed will ultimately time-out and sessionDestroyed will be called. So the mathod is called albeit late. 2. If such is your arrangement, you may better send some token (like '+' or '-') to the independent server which will do addition or substruction from the number of concurrent users. You need not send the 'user' object. Send '+' in sessionCretaed() AND '-' IN SESSIONdESTROYED().
Hope this helps. Regards, Partha ---------- From: Sandeep Kachalia [SMTP:[EMAIL PROTECTED] Sent: Friday, June 18, 2004 4:04 PM To: [EMAIL PROTECTED] Subject: Re: Concurrent Users In continuation to the same problem I have two issues. 1. httpSessionListner Interface sounds good but as per my knowledge sessionDestroyed() method will not be called if browser is closed, so it's difficult to manage concurrency. 2. let say my 'user' class implements httpSessionListner. I have another server( not a web/app server) that manages the count of concurrent users. My web application communiactes to that server using TCP/IP and passes the 'user' object to server.In this scenerio what should be the right way of maintaining the count of concurrent users. Michael Rutherfurd wrote: Having a clustered environment complicates things :-) One solution I am looking at is to leverage existing log4j calls in our code to send messages via a socket appender to a common console gui app. One advantage is that the main servlet code doesn't have to change to support the console which can therefore be developed and enhanced as a independent side project. Note also that as of v2.3 there is a new HttpSessionListener interface with methods sessionCreated() and sessionDestroyed() which gives a more direct indication than the bound/unbound methods of the HttpSessionBindingListener interface. Michael Rutherfurd "A mailing list for discussion about Sun Microsystem's Java Servlet API Technology." <[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]> wrote on 17/06/2004 04:19:15 AM: > Thanks a lot Chris...But will it work in clustered environment where we > can have 2 or more number of web containers. Is it possible to get the > count in Clustered Environment? > > -----Original Message----- > From: A mailing list for discussion about Sun Microsystem's Java ___________________________________________________________________________ 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 ********************************************************************* Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. ********************************************************************* ___________________________________________________________________________ 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