Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Websocket transport is eagerly writing to underlaying websocket without respecting back-pressure. When an event is emitted to multiple clients, socket.io adapter sends the same packet object to all socket clients. These packet objects are shared for all clients inside room. Once the packet is sent to transport, transport prepares buffer with transport headers and packet data and the sharing among clients is lost. This change significantly reduces memory usage when many packets are emitted to many clients in a burst. This change causes that buffered data is sent to clients more evenly packet by packet.
- Loading branch information