Closed iron2han closed 4 years ago
Which old data? how to reproduce the bug? is there a public website?
Anyway, the "e.Buffer includes old data" is true and it is not a bug. You should use the e.Offset and e.Count parameters.
so e.Buffer contains new and valid data only from position e.Offset... and contains e.Count valid bytes.
Ok, I just saw. Is this a feature? This problem didn’t appear when I test other WebSocket connections, thus I suspect it’s a bug. Thanks for replying.
Yes, the buffer comes from a bufferpool (official System.Buffer.ArrayPool). which can contain memory garbage.
Includes old frame data in the results of "args.WebSocketDecoder.Decode()". It is also normal?
code (reference example "ProxyTestController.cs"):
output window:
firefox network debug
No, that is not normal... I've fixed it Please try the latest nuget package (3.1.1288)
It is normally working.
Ok, then I close this issue. feel free to reopen if needed.
I need to get some WebSocket data, but the old data always shows up in “DataReceived”. which has never appeared before in other WebSocket connections. I suspect it is a bug.
` public Form1() { InitializeComponent();
`