1
Vote

Invalid assumption in QbservableProtocol.ReceiveAsync

description

In ReceiveAsync, it is assumed that calling Stream.ReadAsync will return exactly the number of bytes requested, which is not always the case, especially if the network is unreliable. The documentation of ReadAsync states:

"[...] The value of the TResult parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached."

I included an attachment with the code to fix this issue.

p.s. Are you still supporting this project and/or planning to move it to Github ? I saw that you improved Rxx and moved it and so, we would like to know your plans with Qbservable Provider so we can prepare for them.

file attachments

comments