Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] WebSocketListener.onWebSocketClose called numerous times

Hi Joakim, I have changed my custom 9.4.37.v20210219 WebSocketServlet to

    @Override
    public void configure(WebSocketServletFactory factory) {
        factory.getPolicy().setIdleTimeout(5 * 60 * 1000);
        factory.getPolicy().setMaxBinaryMessageSize(0);
        factory.getPolicy().setMaxTextMessageSize(64 * 1024);
        factory.register(MyListener.class);
        factory.setCreator(new MyCreator(this)));
    }

and have started implementing calling sendPing() every 4 minutes for the connected clients, but then I have read your other message at https://stackoverflow.com/a/54654700/165071

"Setting Max Idle Timeout and then causing the connection to not be idle by sending ping/pong isn't ideal."

Do you mean by that, that if my custom WebSocketServlet will send PING every 4 minutes to the browser clients, then the connection will never be idle? Or what do you mean by "isn't ideal"? What else could be done here?

Thank you
Alex

Back to the top