Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-3109

CloseReason always null for WebSocket onClose methods

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 8.1.0.CR2, 8.1.0.Final
    • 8.0.0.Final
    • None
    • None

    Description

      The onClose method of the websocket endpoints does not receive valid CloseReason, it is always null.

      With GlassFish 4.0, the CloseReason is not null and correctly reflects the code and message used to close the wensocket from the client side.

      Simplified code sample of the endpoint:

      @ServerEndpoint(value = "/test", configurator = MyConfigurator.class)
      public class MyEndpoint {
      // onOpen, onMessage and onError, LOGGER are omitted

      @OnClose
      public void onClose(Session session, CloseReason reason) {
      LOGGER.debug("onClose(sessionId={}, reason={})", session.getId(), reason);
      }
      }

      Attachments

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            fbeaufume_jira Tom Tom (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: