code: @OnClose
      public void onClose(Session session, CloseReason closeReason) {
          this.session = session;
  
          clearListeners(closeReason.getCloseCode().getCode(), closeReason.getReasonPhrase());
      }
docs: On closing the websocket, refresh the session and notify all subscribed listeners.
  Upon exit from this method, all subscribed listeners will be removed.
  
  @param session the websocket {@link Session}
  @param closeReason the {@link CloseReason} for the websocket closure