You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Barry Coughlan <b....@gmail.com> on 2015/12/17 17:25:25 UTC

Websocket client creates two threads per SSL client connection - intended or accidental?

Each AsyncChannelWrapperSecure creates two threads, and
WsWebSocketContainer creates an AsyncChannelWrapperSecure for each secure
connection.

Is this behaviour intended or is this a bug?

I initially posted this as a bug because:
1. The behaviour is not mentioned in the Websocket How-To
2. The behaviour only happens with secure connections
3. It's very inefficient, especially considering the How-Tos emphasis on
not using the BIO connector.


Barry

Re: Websocket client creates two threads per SSL client connection - intended or accidental?

Posted by Rémy Maucherat <re...@apache.org>.
2015-12-17 17:25 GMT+01:00 Barry Coughlan <b....@gmail.com>:

> Each AsyncChannelWrapperSecure creates two threads, and
> WsWebSocketContainer creates an AsyncChannelWrapperSecure for each secure
> connection.
>
> Is this behaviour intended or is this a bug?
>
> I initially posted this as a bug because:
> 1. The behaviour is not mentioned in the Websocket How-To
> 2. The behaviour only happens with secure connections
> 3. It's very inefficient, especially considering the How-Tos emphasis on
> not using the BIO connector.
>
> You should really post about this on the user list ...

Tomcat provides a websocket client as required by the specification. The
websocket client is written with NIO2, there's no option to use something
else and is not related in any way to the Tomcat connector.

However, we really only care at this point about the server part of
websocket, and IMO the client is unusable due to missing basic features
(but it is quite fine, you can use thirdparty websocket clients). The
problem is that in the real world a websocket client also needs to be a
good HTTP client (see https://bz.apache.org/bugzilla/show_bug.cgi?id=57767
), so it is a rather bloated component.

Rémy