tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: [OT - question] Limit user sessions in tomcat
Date Thu, 17 Dec 2009 20:29:32 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chuck,

On 12/15/2009 5:01 PM, Caldarale, Charles R wrote:
>> From: André Warnier [mailto:aw@ice-sa.com]
>> 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 thought it was sufficient to call response.flush. Maybe you have to
actually write 0 bytes and then flush (like out.write(buffer, 0, 0);
out.flush()).

But, I haven't actually tried it so I can't confirm.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksqlKwACgkQ9CaO5/Lv0PBrHQCgvR5Sce7ss+a6VFKM67qLA6+D
S4sAn22RBcixFep3P06cZt8WCLPY9f1v
=huNc
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message