Open
Description
I kept running into StackOverflowException when compiled on .Net 6.0, but not .Net 5.0. The issue was mostly happening on fast networks with large packages (1MB). The reason for this was that websocket-sharp uses recursion when receiving packages. After 49 recursions, it ran out of stack memory.
I believe Net6.0 introduced some network optimiazations by increaseing buffers, or similar.
Not sure this is something everyone is exeprienceing, but the recursive architecture is inherently prone to this problem, so I suspect this is going to happen more and more as people switch to Net6.0.
As a possible solution, I will upload a pull request that flattens the receive function.
Metadata
Metadata
Assignees
Labels
No labels