Uh oh!
There was an error while loading. Please reload this page.
Fix PipeStream.Read returning 0 prematurely - #924
Conversation
drieseng
commented
Mar 5, 2022
@IgorMilavec I definitely want this change in, but there are still a few things to consider:
|
IgorMilavec
commented
Mar 6, 2022
publicstaticintReadBlock(thisStreamstream,byte[]buffer,intoffset,intcount){
#region Validate arguments
if(streamisnull){thrownewArgumentNullException(nameof(stream));}
#endregion
intbufferLength=0;while(bufferLength<count){intreadLength=stream.Read(buffer,offset+bufferLength,count-bufferLength);if(readLength==0){break;}bufferLength+=readLength;}returnbufferLength;}Works for every stream, I also have an async version... But generally, |
Just found out that I checked the integration tests and |
Fixes PipeStream.Read to block until more data is received or the session is closed.
This will fix#12, fix#164, fix#440, fix#650