tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <>
Subject Re: [OT - question] Limit user sessions in tomcat
Date Wed, 16 Dec 2009 05:13:51 GMT

"Caldarale, Charles R" <> wrote in message
>> From: André Warnier []
>> Subject: Re: [OT - question] Limit user sessions in tomcat
>> It would seem that there ought to be some low-level response-direction
>> socket flag that should be available, to tell whether the receiving end
>> has gone, without actually having to send anything from a higher-level
>> code module.  But getting to that low-level socket data does not seem
>> to be so easy in Java, is it ?
>It's not hard in Java (Socket.getRemoteSocketAddress() or 
>Socket.isConnected() should work), but there's nothing in >the servlet spec 
>that allows a servlet thread to obtain for that information.  Ideally, the 
>container (Tomcat) would >asynchronously monitor the socket status and set 
>some flag in the Request object for the webapp code to examine at >its 
>leisure.  Might also be able to implement this with a new form of listener.
>I haven't looked at the Servlet 3 spec to see if anything is in there for 
>this rather common problem.

The Servlet 3 spec has something close:  Asynchronous requests (which are 
sort of like Comet in TC 6).  It's more designed to allow the servlet to 
push content to the client (think a JavaScript progress bar).

> - Chuck
>MATERIAL and is >thus for use only by the intended recipient. If you 
>received this in error, please contact the sender and delete the e->mail 
>and its attachments from all computers. 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message