Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

websocketInfo(true) error #9

Open
webonix opened this issue Jun 1, 2024 · 5 comments
Open

websocketInfo(true) error #9

webonix opened this issue Jun 1, 2024 · 5 comments

Comments

@webonix
Copy link

webonix commented Jun 1, 2024

<cfscript>
    dump(var="#server.Lucee#", label="server.Lucee");

    try {
        wsInfo = websocketInfo(true);
       dump(wsInfo)

    } catch (any error) {
        dump(var="#error#", label="ERROR: websocketInfo(true)");
    }

</cfscript>

stacktrace

lucee.runtime.exp.NativeException: The WebSocket session [11] has been closed and no method (apart from close()) may be called on a closed session at org.apache.tomcat.websocket.WsSession.checkState(WsSession.java:806) at org.apache.tomcat.websocket.WsSession.getNegotiatedSubprotocol(WsSession.java:349) at org.lucee.extension.websocket.WebSocketEndpointFactory$Data.getInfoSessionJavax(WebSocketEndpointFactory.java:450) at org.lucee.extension.websocket.WebSocketEndpointFactory$Data.getInfo(WebSocketEndpointFactory.java:361) at org.lucee.extension.websocket.WebSocketEndpointFactory.getInfo(WebSocketEndpointFactory.java:189) at org.lucee.extension.websocket.udf.WebsocketInfo.invoke(WebsocketInfo.java:42) at lucee.runtime.functions.FunctionHandlerPool.invoke(FunctionHandlerPool.java:40) at ws_test_cfm135$cf.call(/ws-test.cfm:6) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1020) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:944) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:214) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:41) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2700) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2687) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2658) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1151) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1108) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97) at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:42) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.lang.IllegalStateException: The WebSocket session [11] has been closed and no method (apart from close()) may be called on a closed session ... 43 more

image
@webonix
Copy link
Author

webonix commented Jun 1, 2024

I have opened and closed a connection in one browser 3 times

But this says 2
systemOutput("--- event WS onMessage how many clients are open? " & static.wsclients.size(),1,0);

and websocketInfo() has this
image

@webonix
Copy link
Author

webonix commented Jun 1, 2024

@michaeloffner
did you say there was a one to one relationship between sessions and instances?
image

@webonix
Copy link
Author

webonix commented Jun 1, 2024

2 sessions, one instance

image

@michaeloffner
Copy link
Contributor

yes there should be a one to one relation, i will run some tests.

@michaeloffner
Copy link
Contributor

@webonix There was indeed a bigger logical bug, we had one component instance per endpoint, but of course multiple session per endpoint. I have fixed that now, now you get one component instance per session per endpoint as it should be.
I have also modified info struct, session and component instances are now group together

Screenshot 2024-06-08 at 23 09 05

hope that does not mess up to much for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants