Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to send a pre-encoded string as a text frame over a WebSocket #27129

Closed
rmacnak-google opened this issue Aug 22, 2016 · 0 comments
Closed
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io

Comments

@rmacnak-google
Copy link
Contributor

In the vm-service, we have have some large (tens of megabytes) responses that are constructed in C++ and efficiently moved to the service isolate without copying as an external Uint8List. Unfortunately, the current WebSocket API doesn't have a way to send a text frame without converting this Uint8List into a String (UTF8 decode), which the WebSocket implementation then converts back to Uint8List (UTF8 encode). The 3x space overhead of the round-trip conversion can be fatal in memory-constrained environments like iOS.

A possible API change would be to add WebSocket.sendMessage(TEXT | BINARY type, List<int> bytes), as proposed in https://chromiumcodereview.appspot.com/2260073002/.

@zanderso @lrhn

@rmacnak-google rmacnak-google added area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io labels Aug 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io
Projects
None yet
Development

No branches or pull requests

2 participants