|
|
|
|
|
by Matthias247
3696 days ago
|
|
Just some comments from looking very briefly at it: The send API lets me wonder how it copes when the socket only allows to send half a frame and then returns EAGAIN/WOULDBLOCK? There is not a number of bytes that were really sent returned, and the ownership of the data to send was given up, so it can't be retried later on. On the receiving side it looks like the framework is allocating the memory and then pushing the received bytes instead of the user allocating the memory and fetching it (after readiness notification). That gives up some potential for memory reuse. |
|
So, the framework itself does not implement any of that, it is on the consumer. It just calls the proper methods on the trait object provided.
https://nathansizemore.github.io/hydrogen/hydrogen/trait.Str...
In the README example, I'm using it combined with another streaming crate I made, which does provide all of the internal buffering and state management for non-blocking I/O.