CaptainCasa WebSockets

getWorkpage().addLifecycleListener(new WorkpageDefaultLifecycleListener()
        {
            @Override
            public void reactOnDestroyed()
            {
                if (m_thread != null)
                    m_thread.i_threadStop = true;
                LongPollingMgr.remove(m_longPollingWebSocket);
            }
        });

this is called only when closing the application.

The event producing thread does not get affected if browser page is closed or refreshed. it keeps running.

How to deal with this ?

Update: The problem was, that i was lacking sessioncloser component in the jsp. It will call destroy() on the Dispatcher when the web page is refreshed or closed, which will call my reactOnDestroyed callback. It works on Workpage level and Outside level



Read more here: https://stackoverflow.com/questions/67933538/captaincasa-websockets

Content Attribution

This content was originally published by Velizar Atanasov at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: