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

Websockets sendText method taking byte[]

XMLWordPrintable

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

      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);
      }

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

                Created:
                Updated:
                Resolved: