NVentimiglia / WebSocket.Portable

C# Portable WebSocket Client Library (Rfc 6455). Works with Xamarin.
Apache License 2.0
11 stars 2 forks source link

Reading large streams of data from underlying TCP connection can fail #6

Closed jonclare closed 8 years ago

jonclare commented 8 years ago

The current implementation seems to assume that all data can be read from the stream in one go.

It looks like this bug was a hold-out from the original esskar implementation

As per the .NET documentation the return value of the ReadAsync method can be less than the number of bytes requested if not everything is available. https://msdn.microsoft.com/en-us/library/hh193669%28v=vs.110%29.aspx

I have noticed issues with large messages (The specific case I've noticed a problem with had a message size of around 28KB)