-
Notifications
You must be signed in to change notification settings - Fork 6k
Equivalent usages section in TCP #32106
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
Equivalent usages section in TCP #32106
Conversation
Creating new article is harder than I expected, can you do a quick review on it @IEvangelist @antonfirsov? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits.
@IEvangelist are you aware about extensive docs on |
Hi @antonfirsov - I'm not sure I follow your question here, are you asking if we have docs on how to write an |
@IEvangelist those docs are exactly what we need, thank you! |
Yeah, the best way to use them is to rely on the Learn Authoring Pack extension in VS Code. |
Co-authored-by: David Pine <david.pine@microsoft.com>
@antonfirsov Should we add more sections? Thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should try to be less verbose. This addition is intended to be a tutorial and general explanation, we don't have to explain all the details IMO.
Co-authored-by: Anton Firszov <antonfir@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should figure out how to create / fix the API links before merging.
This extension for VS Code makes it easy to insert xref (API) links: https://marketplace.visualstudio.com/items?itemName=docsmsft.docs-markdown F1 -> Learn: Link to xref -> [type in some part of the API you want to insert] |
Co-authored-by: Anton Firszov <antonfir@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no more fundamental concerns about the structure/style.
@gewarren or @IEvangelist can you please take a look at the grammar/language here. There's a lot of text, and I'm not native.
Co-authored-by: Anton Firszov <antonfir@gmail.com>
…veans/dotnet-docs into add-tcp-client-socket-equivalent-docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have several nits, a few grammatical suggestions, some code adjustments, and a question or two. Otherwise, it looks good. I was also going to ask, why are there no using
statements? I would like to see anywhere that we're showing IDisposable
implementations that we're either showing them in a using
, does that make sense? For example, instead of:
var client = new TcpClient();
NetworkStream stream = client.GetStream();
We'd show:
using var client = new TcpClient();
using NetworkStream stream = client.GetStream();
Hi @antonfirsov and @liveans - I have provided a review. |
Thanks for the review @IEvangelist !
Well, it doesn't have a specific reason, tbh. I was focusing on equivalent code blocks, instead of those, but it makes sense to me. I'll address them with the next commit. |
Co-authored-by: David Pine <david.pine@microsoft.com>
Merging this, I can make another PR for any follow up comment. @antonfirsov @IEvangelist |
Summary
Adding an article to show TcpClient usages equivalent to Socket under Use TcpClient and TcpListener.
Fixes one task from #31702
Preview
https://review.learn.microsoft.com/en-us/dotnet/fundamentals/networking/sockets/tcp-classes?branch=pr-en-us-32106