tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: WebSocket progress report
Date Wed, 25 Jan 2012 13:00:11 GMT
On 25/01/2012 08:11, Mladen Turk wrote:
> On 01/24/2012 10:15 PM, Mark Thomas wrote:
>> I have made some further headway with this and the latest patch is on
>> people.a.o [1].
>>
> 
> How that relates to Servlet spec 3.1?

TBD :)

Current thinking is that servlet 3.1 will provide some hooks to start
and upgrade process but that protocol implementation will be left to the
container (rather than providing an API that applications could code to
to implement the new protocol).

As it happens, I think we have in Tomcat something that could be turned
into a generic upgrade API that applications could code to but we need
to see how that turns out performance-wise. You'll notice that all the
integration points are protocol neutral so we (or anyone else) could
easily extend this to support other protocols.

The relevant part of the code is in the WebSocketServlet:

// Small hack until the Servlet API provides a way to do this.
StreamListener listener = createWebSocketConnection();
UpgradeConnection uc = ((RequestFacade) req).doUpgrade(listener);
StreamConnection sc = new StreamConnection(uc);
listener.setConnection(sc);

I'm expecting some form of doUpgrade() method to be added to the
HttpServletRequest class but exactly what form that will take is TBD. I
believe the plan is to wait until the WebSocket JSR is further along and
react to their requirements. Hopefully, the experience of Tomcat, Jetty
and others implementing WebSocket will feed into that.

Mark

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


Mime
View raw message