I have an instance of network stream. When using ReadLineAsync
no timeout exception is thrown. No problem with ReadLine
. Why?
NetworkStream stream = GetStream();
stream.ReadTimeout = 1000; //1000ms
var reader = new StreamReader(stream, Encoding.UTF8, true, BufferSize, true);
so:
await reader.ReadLineAsync(); //no timeout error
but:
reader.ReadLine(); //timeout error.
What is going on?