Skip to content

Use async/await to read from the named pipe #7110

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

Merged
merged 1 commit into from
Dec 2, 2021
Merged

Use async/await to read from the named pipe #7110

merged 1 commit into from
Dec 2, 2021

Conversation

meziantou
Copy link
Contributor

Details of Changes

  • Simplify the code by using ReadAsync
  • Fix a logic issue: Using UTF8.GetString on an incomplete buffer may generate invalid strings (example). The new code is using a MemoryStream to get the message content until the message is complete.

@gave92
Copy link
Member

gave92 commented Nov 28, 2021

Can the same be done on the other side of the pipe connection?

@meziantou
Copy link
Contributor Author

Can the same be done on the other side of the pipe connection?

Yes, I can do it. I prefer to keep MR small. So, I can do it in another MR as the two changes can be merged independently.

@meziantou
Copy link
Contributor Author

The follow-up PR: #7130

@gave92 gave92 added ready to merge Pull requests that are approved and ready to merge and removed needs - code review labels Dec 2, 2021
@yaira2 yaira2 merged commit c7d3433 into files-community:main Dec 2, 2021
@gave92 gave92 mentioned this pull request Dec 3, 2021
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants