tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <>
Subject RE: Can tomcat detect disconnection by client side in Async mode?
Date Fri, 10 Dec 2010 22:30:45 GMT
> From: Michael Ludwig [] 
> Subject: Re: Can tomcat detect disconnection by client side in Async mode?

> Are there any servers at all that proactively notify their
> children or threads of aborted connections in order to stop
> them from serving them

None that I'm aware of, since the TCP/IP stack doesn't pass that information along unless
asked.  Something on the server side of the connection would have to access the socket in
order to see if the other end is still alive, and the request processing thread has control
of the socket, so other server code can't really presume to use it.

> 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 socket?

There is a Socket.isOutputShutdown() method that /might/ indicate that the client sent an
RST, but the exact JRE implementation may well be platform-specific.  Failing that, writing
to the socket is the only way I know of to be sure if the client is still listening (and even
that's not a guarantee).

 - Chuck

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