websocket-spec
  1. websocket-spec
  2. WEBSOCKET_SPEC-138

websockets api javadoc: include message handler registration for onOpen method

    Details

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

      Description

      1) I think it would be useful to have an example for typical onOpen() usage:

      Example:
      @Override
      public void onOpen(Session s) {
      final RemoteEndpoint remote = session.getRemote();
      s.addMessageHandler(new MessageHandler.Basic<String>() {
      public void onMessage(String text) {
      try

      { remote.sendString("Pong from server:"+text); }

      catch(Exception ex)

      { ... }

      }
      }
      }

      2) I think it should be useful to link this example in Session.addMessageHandler, and in MessageHandler.*.onMessage() sections
      3) Since onMessage() is of type void it would be useful to have an example where the RemoteEndpoint obtained, like in 1)

        Activity

        mikc22 created issue -
        dannycoward made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee dannycoward [ dannycoward ]
        Tags v013
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: