tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Ludwig <>
Subject Re: Can tomcat detect disconnection by client side in Async mode?
Date Fri, 10 Dec 2010 21:28:03 GMT
Justin Randall schrieb am 07.12.2010 um 00:16 (+0000):
> Without knowing the application and going on standard sockets,
> I know from experience without using Async mode that Tomcat does
> generate a ClientAbortException when a TCP RST is received from
> a client when Tomcat is writing the HTTP response to the client.

Which seems to mean that it is only upon request completion, or
at any rate after beginning to write the answer, that Tomcat, or
rather, the specific thread attempting to write to the socket,
has a chance of being notified of an aborted client connection.

So, there is no such thing as an active client connection registry
maintained by the server, or possibly some other implementation
property which a thread could check to find out about the state
of the connection, is there?

> The client was a CPE which downloaded firmware/config via HTTP
> and sent a TCP RST after the first chunk of data if the version
> on the server and in the CPE were identical.  Not sure if this
> is relevant and what the behaviour of your client would be for
> "disconnecting" from the server (assuming it's not a web
> browser).

I'd really like to know the truth about this age-old myth, of
which there's an example in this old message back from 2000:

RE: STOP button of browser causes connection leak..

  "One of our engineers said that the web server should pick up on
  the connection being dead (back to the browser) so should abort
  the thread."

Are there any servers at all that proactively notify their
children or threads of aborted connections in order to stop them
from serving them, or at least provide them the opportunity to
cooperatively abort themselves when discovering an aborted
connection - other than by having them attempt to write to the

Has anyone ever encountered any server at all caring in such a way
about connections? Or is it all just what I labeled it - a myth?

> -----Original Message-----
> From: Ben <>
> Date: Sun, 5 Dec 2010 14:25:56 

> Any idea about the disconnection handling? Cannot find reference
> for this.
> In my application the client may disconnect and send a new
> request with different parameters. On server side I wanna clean
> the AsynContext held by previous request. Right now only timeout
> will do, which is not efficient cos I set the timeout to quite
> high value to avoid frequent disconnect / connect.

Michael Ludwig

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

View raw message