Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8159321

[spec] WebSockets: Need to update onError spec for misc issues

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      This is a new bug for JDK-8156678. The API was concluded to work properly but needs to clarify some situation in specs.

      By Pavel:
      >> 1. if there is any runtime exception thrown in onText, should it be treated as "an I/O or protocol error" as documented in onError? I really doubt this.

      You're right this requires a tiny spec clarification.

      >> 3. What does "no more messages can be sent on this WebSocket." mean? If it is considered to throw any exception such as IllegalStateException, it should be documented in the WebSocket.sendXXX() methods.

      It should be read and understood in context: "In such cases the implementation takes care of closing the WebSocket. By the time onError is invoked, no more messages can be sent on this WebSocket." In other words, messages cannot be sent because WS is closing.
      Okay I see where you're coming from. If you find this particular phrase vague we can remove/change it. The point is that *sometimes* when onError is called WebSocket is closed automatically.

      Attachments

        Activity

          People

            prappo Pavel Rappo
            xiaofeya Xiaofeng Yang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: