nats-io / nats.net.v1

The official C# Client for NATS
Apache License 2.0
646 stars 154 forks source link

Fix line reader to resolve buffer issues on TLS connections #888

Closed mtmk closed 4 months ago

mtmk commented 4 months ago

The StreamReader usage when reading the server INFO causes buffer issues on the stream, as it is also read in the reader loop. The StreamReader might consume or return the read bytes back, leading to problems when used on a TLS connection with .NET versions lower than 8. This fix removes the StreamReader usage to address these issues.

fixes https://github.com/nats-io/nats.net/issues/586#issuecomment-2076701242