Skip to content

Moving from 1.1.2 to 1.2.* causes constant disconnect/connect events #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kmgallahan opened this issue Apr 11, 2025 · 2 comments
Open

Comments

@kmgallahan
Copy link

I just spent 6 hours debugging why my serial device was no longer working. There were constant IO exceptions getting thrown, which were triggered by this line:

https://github.com/dotnet/runtime/blob/be6100ed084ced3b5803a6b998c112b85c1a6f64/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialStream.Windows.cs#L899

Which is stated as "(almost impossible to run into)", and even though stepping through in the debugger shows the ReadTimout as 5000 and not equaling SerialPort.InfiniteTimeout, the if condition is still passing, thus resulting in the exception, thus causing this lib to disconnect.

Moving to 1.1.2 makes the problem go away as it doesn't use BaseStream.ReadAsync.

@genemars
Copy link
Member

What OS and .net version?

@kmgallahan
Copy link
Author

Windows 10 19045.5608 w/ .NET 9

Part of what took so long was thinking it might be a hardware issue. Strangely, it worked fine on my desktop (seemingly, it wasn't immediately failing anyways), but fails on a Surface Pro 7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants