Skip to content
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

Override memory-based ReadAsync & WriteAsync for SerialStream #56866

Merged
merged 9 commits into from
Aug 9, 2021

Conversation

i3arnon
Copy link
Contributor

@i3arnon i3arnon commented Aug 4, 2021

Contributes to #54575

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Aug 4, 2021
@ghost
Copy link

ghost commented Aug 4, 2021

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

Fix #54575

Author: i3arnon
Assignees: -
Labels:

area-System.IO

Milestone: -

@i3arnon
Copy link
Contributor Author

i3arnon commented Aug 4, 2021

Seems to also contribute to #54916

@@ -10,9 +10,6 @@

namespace System.IO.Ports
{
// Issue https://github.com/dotnet/runtime/issues/54916
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the Windows part? I know it's very archaic, but it seems that the implementation uses ReadFile and WriteFile methods, which means that we could just create a FileStream (with buffering disabled by passing bufferSize: 1) from the SafeFileHandle we get in

public SafeFileHandle OpenPort(uint portNumber)
{
return Interop.Kernel32.CreateFile(
and delegate all reads and writes to FileStream.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look, but it feels like a separate PR to me..

@adamsitnik adamsitnik added this to the 7.0.0 milestone Aug 5, 2021
@i3arnon i3arnon requested a review from adamsitnik August 8, 2021 12:45
Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you @i3arnon !

@adamsitnik adamsitnik modified the milestones: 7.0.0, 6.0.0 Aug 9, 2021
@adamsitnik adamsitnik merged commit ec07ac8 into dotnet:main Aug 9, 2021
@i3arnon i3arnon deleted the serial-stream-memory branch August 9, 2021 11:20
@ghost ghost locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.IO community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants