socket.io-protocol
socket.io-protocol copied to clipboard
fix: `waitFor` message latency causing missed packets
This PR fix issue #32. The proposed solution is to extend the ws WebSocket instance to add an async iterator working with the utility function createWebSocketStream coming from the ws library.
It has a minimal impact on the test suite codebase.
Hi! Thanks for the pull request :+1:
I think it could also be fixed with a buffer, something like this: https://github.com/socketio/socket.io-protocol/commit/49fe300a835d2f90cbc2c058c9ad4cc501c12f43
What do you think?
Your solution also work, it has the advantage that it is also working on the browser whereas mine only works for node.js (because it uses the official stream implementation).
This issue also need to be fixed on the engine.io test-suite (I already prepared all the patches with my solution). But if you prefer to do your's, no problem.