-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Added documentation for APIs in System.Net namespace introduced in 2.x #3280
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -196,9 +196,22 @@ | |||||
<Parameter Name="address" Type="System.ReadOnlySpan<System.Byte>" Index="0" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1" /> | ||||||
</Parameters> | ||||||
<Docs> | ||||||
<param name="address">To be added.</param> | ||||||
<summary>To be added.</summary> | ||||||
<remarks>To be added.</remarks> | ||||||
<param name="address">The byte span value of the IP address.</param> | ||||||
jozkee marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
<summary>Initializes a new instance of the <see cref="T:System.Net.IPAddress" /> class with the address specified as a byte span.</summary> | ||||||
<remarks> | ||||||
<format type="text/markdown"><![CDATA[ | ||||||
|
||||||
## Remarks | ||||||
The <xref:System.Net.IPAddress> is created with the <xref:System.Net.IPAddress.Address> property set to `address`. | ||||||
|
||||||
If the length of `address` is 4, this method constructs an IPv4 address; otherwise, an IPv6 address with a scope of 0 is constructed. | ||||||
|
||||||
The byte span is assumed to be in network byte order with the most significant byte first in index position 0. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these be documented in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's one reason, but also these remarks are all specific to the one param. |
||||||
|
||||||
]]></format> | ||||||
</remarks> | ||||||
<exception cref="T:System.ArgumentException"> | ||||||
<paramref name="address" /> contains a bad IP address.</exception> | ||||||
</Docs> | ||||||
</Member> | ||||||
<Member MemberName=".ctor"> | ||||||
|
@@ -285,10 +298,25 @@ | |||||
<Parameter Name="scopeid" Type="System.Int64" Index="1" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1" /> | ||||||
</Parameters> | ||||||
<Docs> | ||||||
<param name="address">To be added.</param> | ||||||
<param name="scopeid">To be added.</param> | ||||||
<summary>To be added.</summary> | ||||||
<remarks>To be added.</remarks> | ||||||
<param name="address">The byte span value of the IP address.</param> | ||||||
<param name="scopeid">The long value of the scope identifier.</param> | ||||||
<summary>Initializes a new instance of the <see cref="T:System.Net.IPAddress" /> class with the address specified as a byte span and the specified scope identifier.</summary> | ||||||
<remarks> | ||||||
<format type="text/markdown"><![CDATA[ | ||||||
|
||||||
## Remarks | ||||||
This constructor instantiates an IPv6 address. The `scopeid` identifies a network interface in the case of a link-local address. The scope is valid only for link-local and site-local addresses. | ||||||
|
||||||
The byte span is assumed to be in network byte order with the most significant byte first in index position 0. | ||||||
|
||||||
]]></format> | ||||||
</remarks> | ||||||
<exception cref="T:System.ArgumentException"> | ||||||
<paramref name="address" /> contains a bad IP address.</exception> | ||||||
<exception cref="T:System.ArgumentOutOfRangeException"> | ||||||
<paramref name="scopeid" /> < 0 | ||||||
- or - | ||||||
jozkee marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
<paramref name="scopeid" /> > 0x00000000FFFFFFFF</exception> | ||||||
mairaw marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
</Docs> | ||||||
</Member> | ||||||
<Member MemberName="Address"> | ||||||
|
@@ -1686,10 +1714,12 @@ | |||||
<Parameter Name="ipString" Type="System.ReadOnlySpan<System.Char>" Index="0" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1" /> | ||||||
</Parameters> | ||||||
<Docs> | ||||||
<param name="ipString">To be added.</param> | ||||||
<summary>To be added.</summary> | ||||||
<returns>To be added.</returns> | ||||||
<param name="ipString">A character span that contains an IP address in dotted-quad notation for IPv4 and in colon-hexadecimal notation for IPv6.</param> | ||||||
<summary>Converts an IP address represented as a character span to an IPAddress instance.</summary> | ||||||
jozkee marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we use the language "converts" elsewhere in docs when we are parsing a string? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @scalablecory It is used in the other method signature, also it is used in |
||||||
<returns>An <see cref="T:System.Net.IPAddress" /> instance.</returns> | ||||||
jozkee marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
<remarks>To be added.</remarks> | ||||||
<exception cref="T:System.FormatException"> | ||||||
<paramref name="ipString" /> is not a valid IP address.</exception> | ||||||
</Docs> | ||||||
</Member> | ||||||
<Member MemberName="Parse"> | ||||||
|
@@ -1917,10 +1947,10 @@ | |||||
<Parameter Name="charsWritten" Type="System.Int32" RefType="out" Index="1" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1" /> | ||||||
</Parameters> | ||||||
<Docs> | ||||||
<param name="destination">To be added.</param> | ||||||
<param name="charsWritten">To be added.</param> | ||||||
<summary>To be added.</summary> | ||||||
<returns>To be added.</returns> | ||||||
<param name="destination">When this method returns, the IP address as a span of characters.</param> | ||||||
<param name="charsWritten">When this method returns, the number of characters written into the span.</param> | ||||||
<summary>Tries to format the current IP address into the provided span.</summary> | ||||||
<returns><see langword="true" /> if the formatting was successful; otherwise, <see langword="false" />.</returns> | ||||||
<remarks>To be added.</remarks> | ||||||
</Docs> | ||||||
</Member> | ||||||
|
@@ -1954,10 +1984,10 @@ | |||||
<Parameter Name="address" Type="System.Net.IPAddress" RefType="out" Index="1" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1" /> | ||||||
</Parameters> | ||||||
<Docs> | ||||||
<param name="ipString">To be added.</param> | ||||||
<param name="address">To be added.</param> | ||||||
<summary>To be added.</summary> | ||||||
<returns>To be added.</returns> | ||||||
<param name="ipString">The byte span to validate.</param> | ||||||
<param name="address">The <see cref="T:System.Net.IPAddress" /> version of the byte span.</param> | ||||||
jozkee marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
<summary>Determines whether a byte span represents a valid IP address.</summary> | ||||||
jozkee marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
<returns><see langword="true" /> if <paramref name="ipString" /> was able to be parsed as an IP address; otherwise, <see langword="false" />.</returns> | ||||||
<remarks>To be added.</remarks> | ||||||
</Docs> | ||||||
</Member> | ||||||
|
@@ -2044,10 +2074,10 @@ | |||||
<Parameter Name="bytesWritten" Type="System.Int32" RefType="out" Index="1" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1" /> | ||||||
</Parameters> | ||||||
<Docs> | ||||||
<param name="destination">To be added.</param> | ||||||
<param name="bytesWritten">To be added.</param> | ||||||
<summary>To be added.</summary> | ||||||
<returns>To be added.</returns> | ||||||
<param name="destination">When this method returns, the IP address as a span of bytes.</param> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree but shouldn't it be "contains" instead of "receives"? I also agree on the "When this method returns There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "contains" to me is a little confusing because it sounds like a precondition to calling this method. "receives" tells me it will have the IP address written to it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mairaw thoughts on true vs langword true? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need to say contains. So what happens when the method returns false? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mairaw if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@scalablecory Your suggestion is correct: we should use +1 What @mairaw said: We should mention what the contents of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd be okay leaving without true or false as well. I just wouldn't say I'd simply say "When this method returns, " People should be checking the result of the method anyway before trying to use these, I'd say |
||||||
<param name="bytesWritten">When this method returns, the number of bytes written into the span.</param> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this suggestion is correct. What @jozkee wrote might be enough, if he can confirm that the method sets this to zero on failure. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer the original version better. So if it's simply 0 when false, the original sentence still looks good. |
||||||
<summary>Tries to write the current IP address into a span of bytes.</summary> | ||||||
<returns><see langword="true" /> if the IP address is sucessfully written to the given span; otherwise, <see langword="false" />.</returns> | ||||||
<remarks>To be added.</remarks> | ||||||
</Docs> | ||||||
</Member> | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.