Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-1502

[Websocket] Set specific CloseMessage for timeout and set a listener for that event

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Unresolved
    • Major
    • None
    • None
    • None

    Description

      In the current WebsocketChannel API it is possible to set an idle timeout through: channel.setIdleTimeout().
      It seems like the resulting CloseMessage out of a timeout is:

      code = 1001 (Going Away)
      reason = ""

      So there is no way for a client to differentiate between a timeout from a normal server close.

      I am not using the JSR extension but I know that in the JSR spec, they use 1006.

      Would it be possible to either set a specific CloseMessage code, or a specific CloseMessage reason, or the ability for the application to catch the timeout close event and send a custom CloseMessage.

      I am also interested to be able to catch the timeout event for metric purposes. Maybe it is possible with the current API and I missed the way to do it.

      I can do a PR given a little bit of guidance.

      Attachments

        Activity

          People

            flaviarnn Flavia Rainone
            rubenfiszel Ruben Fiszel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: