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

Websockets sendText method taking byte[]

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Minor
    • 1.1.Beta2
    • 1.1.Beta1
    • Core
    • None
    • Low

    Description

      Current WebSockets::sendText method takes a String input, converts it to byte[], wraps it in ByteBuffer and delegates to private method sendInternal

      I'm developing a server that repeatedly sends same text message to several thousands websockets and all this conversions add up. Would it be possible to add this method variant, taking a byte[] of UTF-8 encoded text:

      public static void sendText(byte[] message, WebSocketChannel wsChannel, WebSocketCallback<Void> callback) {
      ByteBuffer data = ByteBuffer.wrap(message);
      sendInternal(new ByteBuffer[]

      {data}

      , WebSocketFrameType.TEXT, wsChannel, callback);
      }

      Attachments

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            vnesek_jira Vjekoslav Nesek (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: