Search code examples
c#streamreadernetworkstream

Is StreamReader.Read() a blocking method?


Is StreamReader.Read() a blocking method especially if applied to a NetworkStream?


Solution

  • Yes - it blocks until one of the follow conditions is satisfied:

    • A character is read
    • The end of the underlying stream is reached
    • The underlying stream throws an exception