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

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

XMLWordPrintable

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

      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.

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

                Created:
                Updated: