websocket-spec
  1. websocket-spec
  2. WEBSOCKET_SPEC-117

Provide way to inform developers when connections timeout or close (without close frames being sent)

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      I can't see how the endpoint can be notified that its connection has timed out (or disconnected w/o a close.)

      Should there be a CloseCodes.TIMEOUT (or READ/WRITE_TIMEOUT), and CloseCodes.CONNECTION_DISCONNECT?

      Or should there be some exceptions for @WebSocketError like WebSocketTimeoutException (or WebSocketRead/WriteTimeout) and WebSocketDisconnectException.

        Activity

        Hide
        dannycoward added a comment -

        We determined in the eg that the onClose method should be called whether the close is as a result of a remotely sent close frame, or locally due to some event like a timeout.

        To distinguish between the two, we're going to use the reserved 1006 code (which the websocket protocol disallows from use in a close frame) for locally initiated closes, with suitable reason phrase.

        Show
        dannycoward added a comment - We determined in the eg that the onClose method should be called whether the close is as a result of a remotely sent close frame, or locally due to some event like a timeout. To distinguish between the two, we're going to use the reserved 1006 code (which the websocket protocol disallows from use in a close frame) for locally initiated closes, with suitable reason phrase.

          People

          • Assignee:
            dannycoward
            Reporter:
            dannycoward
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved: