tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Dodunski" <ChrisFromSquir...@christopher.net.nz>
Subject Re: Using custom Configurator with WebSockets
Date Mon, 29 Apr 2019 00:44:54 GMT
Your idea of wrapping the interface returned by the registry was a stroke
of brilliance!  And I'm pleased to say it was successful.

I'm now working to resolve another small hiccup.  The IoC registry can be
configured to provide the service as either a singleton or a new instance
for each new thread.  I chose the latter.  Socket connections are
established without problem, but if Tomcat subsequently calls @OnError
and/or @OnClose on a connection, the IoC registry provides a new instance
(not good).  This suggests that the subsequent method call on the socket
comes via a new thread.  So bit of a mismatch there between sessions and
threads.

I may have to move to a singleton service, meaning no longer being able to
persist connection endpoints to a static map with a simple:
connections.put(this).

Thanks again,

Chris.


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


Mime
View raw message