TerminatedReadAsync(terminator, timeout) does not actually terminate the read at the inputted termintor character.
For example, when the stream contains the following bytes:
\n \nXX\r\nYYYY YY YY YYYYYYY YYYYYYYY \"ZZZZ\"\r\n
and terminated read is called as await TerminatedReadAsync(PrimS.Telnet.Client.Rfc854LineFeed, ReadTimeout)
it is expected that only \n \nXX\r\n is returned.
Instead the entire contents of the stream is returned.
This is because, in ByteStreamHandlerCancellable line 89, RetrieveAndParseResponse(sb) is looped over the entire contents of the stream without checking for the terminator.
The check for the terminator is only done by the calling method in Client.cs line 154 when all the bytes from the stream have already been returned.
Have I misunderstood how this method is supposed to work?
TerminatedReadAsync(terminator, timeout) does not actually terminate the read at the inputted termintor character.
For example, when the stream contains the following bytes:
\n \nXX\r\nYYYY YY YY YYYYYYY YYYYYYYY \"ZZZZ\"\r\n
and terminated read is called as
await TerminatedReadAsync(PrimS.Telnet.Client.Rfc854LineFeed, ReadTimeout)
it is expected that only
\n \nXX\r\n
is returned.Instead the entire contents of the stream is returned.
This is because, in ByteStreamHandlerCancellable line 89,
RetrieveAndParseResponse(sb)
is looped over the entire contents of the stream without checking for the terminator.The check for the terminator is only done by the calling method in Client.cs line 154 when all the bytes from the stream have already been returned.
Have I misunderstood how this method is supposed to work?