Totodore / socketioxide

A socket.io server implementation in Rust that integrates with the Tower ecosystem and the Tokio stack.
https://docs.rs/socketioxide
MIT License
1.21k stars 52 forks source link

fix(engineio/socket): atomically adjacent packet requirement for binary payloads #287

Closed Totodore closed 6 months ago

Totodore commented 6 months ago

Motivation

Solution

Change the engine.io socket internal channel so that it can take multiple packets at once. It is backed by smallvec which allows to put packets on the stack for small sizes before moving to the heap. This will avoid slowdowns where there is only one packet sent (most of the time).