[jsr369-experts] Re: Upgrade is done?

From: Mark Thomas <markt_at_apache.org>
Date: Wed, 11 Feb 2015 21:40:14 +0000

On 11/02/2015 05:08, Greg Wilkins wrote:
> All,
> Jetty currently doesn't implement the standard upgrade mechanism and I'm
> currently looking to fix that. The spec says:
> When the upgrade processing is done, HttpUpgradeHandler.destroy will
> be invoked.
> What does "is done" mean? Does it mean both input and output streams
> have been closed?

Tomcat took that to mean if either of those streams was closed. Tomcat
ensures both streams are closed and then calls destroy().

> I also note that the spec says async IO can be used, so I assume that
> means that startAsync must be called before returning after the
> request.upgrade call?

Tomcat took that to mean that you could set a ReadListener and a
WriteListener on the Streams if you wanted to use non-blocking.

The main reasons for the above choices were:
- the choices looked to be consistent with the spec
- the choices worked for Tomcat's WebSocket on top of Servlet API impl