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 APIs for corking/uncorking messages to the uws FFI bindings #135

Open
rdw-software opened this issue Apr 23, 2023 · 0 comments
Open

Comments

@rdw-software
Copy link
Member

While this is done by default in the uWS API, it might be useful to give more fine-grained control via an explicit corking API.

Outline: https://gist.github.com/Duckwhale/707ae8101f848de38a8f622f07ada193


Background information:

See https://github.com/uNetworking/uWebSockets/blob/master/misc/READMORE.md#corking

And the following summary:

Corking, in the context of uWebSockets, refers to a technique used for optimizing and controlling the data flow between a server and a client. uWebSockets is a C++ library for building high-performance web servers, and it supports the WebSocket protocol for real-time communication.

Corking is a method of temporarily holding or buffering outgoing data to be sent over a connection, then flushing or sending that data as a single, larger message instead of multiple smaller ones. The process of corking and uncorking aims to reduce network overhead and improve the overall throughput by minimizing the number of TCP packets and system calls.

You should use corking when:

  • You have multiple small data chunks to send over a WebSocket connection.
  • You want to reduce the latency and overhead associated with sending multiple small messages.
  • You aim to improve the throughput and overall performance of your application.
  • You need better control over the data flow between the server and the client.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Soon™
Development

No branches or pull requests

1 participant