Skip to content

Conversation

@jozkee
Copy link
Member

@jozkee jozkee commented Jun 28, 2019

List of APIs documented:

  • CookieCollection:
  1. M:System.Net.CookieCollection.Clear
  2. M:System.Net.CookieCollection.Contains(System.Net.Cookie)
  3. M:System.Net.CookieCollection.Remove(System.Net.Cookie)
  4. M:System.Net.CookieCollection.System#Collections#Generic#IEnumerable<System#Net#Cookie>#GetEnumerator
  • FileWebRequest:
  1. M:System.Net.FileWebRequest.GetRequestStreamAsync
  2. M:System.Net.FileWebRequest.GetResponseAsync
  • IPEndPoint:
  1. M:System.Net.IPEndPoint.Parse(System.ReadOnlySpan{System.Char})
  2. M:System.Net.IPEndPoint.Parse(System.String)
  3. M:System.Net.IPEndPoint.TryParse(System.String,System.Net.IPEndPoint@)
  4. M:System.Net.IPEndPoint.TryParse(System.ReadOnlySpan{System.Char},System.Net.IPEndPoint@)

@jozkee jozkee requested a review from karelz as a code owner June 28, 2019 23:26
@jozkee
Copy link
Member Author

jozkee commented Jun 28, 2019

@davidsh @wfurt @krwq @scalablecory since you are the System.Net owners, could you please take a look?

@jozkee
Copy link
Member Author

jozkee commented Jun 28, 2019

@mairaw @rpetrusha

@mairaw mairaw added new-content Indicates PRs that contain new articles 🏁 Release: .NET Core 3.0 :checkered_flag: Release: .NET Core 3.0 labels Jun 28, 2019
@mairaw mairaw added this to the June 2019 milestone Jun 28, 2019
<remarks>To be added.</remarks>
<param name="cookie">The <see cref="T:System.Net.Cookie" /> to remove form the <see cref="T:System.Net.CookieCollection" />.</param>
<summary>Determines whether the <paramref name="cookie" /> is in the <see cref="T:System.Net.CookieCollection" />.</summary>
<returns><see langword="true" /> if item was successfully removed from the <see cref="T:System.Net.CookieCollection" />; otherwise, <see langword="false" />. This method also returns <see langword="false" /> if item is not found in the original collection.</returns>
Copy link
Contributor

Choose a reason for hiding this comment

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

if item is not found in the original collection

Was this copied from ICollection? There is no "item" parameter here.

<returns>To be added.</returns>
<remarks>To be added.</remarks>
<summary>Returns a <see cref="T:System.IO.Stream" /> object for writing data to the file system resource as an asynchronous operation.</summary>
<returns>The Task object representing the asynchronous operation.</returns>
Copy link
Contributor

Choose a reason for hiding this comment

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

"Task" -> <see cref="...Task"/>.

Copy link
Contributor

Choose a reason for hiding this comment

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

@scalablecory @jozkee there is a neat feature to help provide code suggestions that can be bulk merged:

Suggested change
<returns>The Task object representing the asynchronous operation.</returns>
<returns>The <see cref="T:System.Threading.Tasks.Task" /> object representing the asynchronous operation.</returns>

Copy link
Contributor

Choose a reason for hiding this comment

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

Note: The comment is already outdated so you may ignore it.

<summary>To be added.</summary>
<returns>To be added.</returns>
<param name="s">A <see cref="T:System.RedOnlySpan`1" /> that contains an IP endpoint in dotted-quad notation or network byte order for IPv4 and in colon-hexadecimal notation for IPv6.</param>
<summary>Converts an IP network endpoint (address and port) represented as a <see cref="T:System.RedOnlySpan`1" /> to an IPEndPoint instance.</summary>
Copy link
Contributor

Choose a reason for hiding this comment

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

RedOnlySpan -> ReadOnlySpan

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<summary>Converts an IP network endpoint (address and port) represented as a <see cref="T:System.RedOnlySpan`1" /> to an IPEndPoint instance.</summary>
<summary>Converts an IP network endpoint (address and port) represented as a <see cref="T:System.ReadOnlySpan`1" /> to an <see cref="T:System.Net.IPEndPoint" /> instance.</summary>

<param name="s">A <see cref="T:System.RedOnlySpan`1" /> that contains an IP endpoint in dotted-quad notation or network byte order for IPv4 and in colon-hexadecimal notation for IPv6.</param>
<summary>Converts an IP network endpoint (address and port) represented as a <see cref="T:System.RedOnlySpan`1" /> to an IPEndPoint instance.</summary>
<returns>An <see cref="T:System.Net.IPEndPoint" /> instance.</returns>
<remarks>To be added.</remarks>
Copy link
Contributor

Choose a reason for hiding this comment

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

Remarks still todo?

Copy link
Member Author

Choose a reason for hiding this comment

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

Since overloads are generated in the same html, for this case and TryParse I think it would be redundant to have practically the same remarks twice.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that's good. But if they are applicable to both, the best would be to create a MemberGroup element and add the remarks there.

Here's an example I did this for:
6950528
https://docs.microsoft.com/en-us/dotnet/api/windows.foundation.point.tostring?view=dotnet-uwp-10.0

Otherwise, only one of the overloads have those remarks:
https://review.docs.microsoft.com/en-us/dotnet/api/system.net.ipendpoint.tryparse?view=netcore-3.0&branch=pr-en-us-2663#System_Net_IPEndPoint_TryParse_System_String_System_Net_IPEndPoint__

I can help you to format that in this PR if you'd like.

Copy link
Contributor

Choose a reason for hiding this comment

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

Remarks are optional, @scalablecory

<returns>To be added.</returns>
<remarks>To be added.</remarks>
<summary>Returns a response to a file system request as an asynchronous operation.</summary>
<returns>The Task object representing the asynchronous operation.</returns>
Copy link
Contributor

Choose a reason for hiding this comment

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

"Task" -> <see cref="...Task"/>.

<format type="text/markdown"><![CDATA[
## Remarks
> [!NOTE]
> In the case of asynchronous requests, it is the responsibility of the client application to implement its own time-out mechanism.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be a link to something describing how to implement time-outs?

Copy link
Member Author

Choose a reason for hiding this comment

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

there is an example for HttpWebRequest.BeginGetResponse I could adapt it to FileWebRequest.GetResponseAsync in case is really needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Created issue #2672 to address this later.

@mairaw
Copy link
Contributor

mairaw commented Jun 29, 2019

Copy link
Contributor

@mairaw mairaw left a comment

Choose a reason for hiding this comment

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

Nice job documenting these @jozkee! Left a few comments for you.

<summary>To be added.</summary>
<returns>To be added.</returns>
<param name="s">A <see cref="T:System.RedOnlySpan`1" /> that contains an IP endpoint in dotted-quad notation or network byte order for IPv4 and in colon-hexadecimal notation for IPv6.</param>
<summary>Converts an IP network endpoint (address and port) represented as a <see cref="T:System.RedOnlySpan`1" /> to an IPEndPoint instance.</summary>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<summary>Converts an IP network endpoint (address and port) represented as a <see cref="T:System.RedOnlySpan`1" /> to an IPEndPoint instance.</summary>
<summary>Converts an IP network endpoint (address and port) represented as a <see cref="T:System.ReadOnlySpan`1" /> to an <see cref="T:System.Net.IPEndPoint" /> instance.</summary>

<param name="s">A <see cref="T:System.RedOnlySpan`1" /> that contains an IP endpoint in dotted-quad notation or network byte order for IPv4 and in colon-hexadecimal notation for IPv6.</param>
<summary>Converts an IP network endpoint (address and port) represented as a <see cref="T:System.RedOnlySpan`1" /> to an IPEndPoint instance.</summary>
<returns>An <see cref="T:System.Net.IPEndPoint" /> instance.</returns>
<remarks>To be added.</remarks>
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that's good. But if they are applicable to both, the best would be to create a MemberGroup element and add the remarks there.

Here's an example I did this for:
6950528
https://docs.microsoft.com/en-us/dotnet/api/windows.foundation.point.tostring?view=dotnet-uwp-10.0

Otherwise, only one of the overloads have those remarks:
https://review.docs.microsoft.com/en-us/dotnet/api/system.net.ipendpoint.tryparse?view=netcore-3.0&branch=pr-en-us-2663#System_Net_IPEndPoint_TryParse_System_String_System_Net_IPEndPoint__

I can help you to format that in this PR if you'd like.

## Remarks
The number of parts (each part is separated by a period) in the string s determines how the endpoint's IP address is constructed. A one part address is stored directly in the network address. A two part address, convenient for specifying a class A address, puts the leading part in the first byte and the trailing part in the right-most three bytes of the network address. A three part address, convenient for specifying a class B address, puts the first part in the first byte, the second part in the second byte, and the final part in the right-most two bytes of the network address. For Example:
|Number of parts and example `s`|IPv4 address for IPEndPoint.Address|Port
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
|Number of parts and example `s`|IPv4 address for IPEndPoint.Address|Port
|Number of parts and example `s`|IPv4 address for IPEndPoint.Address|Port|

|2 -- "20.65535:23"|20.0.255.255|23|
|3 -- "128.1.2:443"|128.1.0.2|443|
Note that this method accepts as valid an string value that can be parsed as an Int64, and then treats that Int64 as the long value of an IP address in network byte order, similar to the way that the IPAddress constructor does. This means that this method returns true if the Int64 is parsed successfully, even if it represents an address that's not a valid IP address. For example, if s is "1", this method returns true even though "1" (or 0.0.0.1) is not a valid IP address and you might expect this method to return false. Fixing this bug would break existing apps, so the current behavior will not be changed. Your code can avoid this behavior by ensuring that it only uses this method to parse IP addresses in dotted-decimal format.
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like an important note.

Suggested change
Note that this method accepts as valid an string value that can be parsed as an Int64, and then treats that Int64 as the long value of an IP address in network byte order, similar to the way that the IPAddress constructor does. This means that this method returns true if the Int64 is parsed successfully, even if it represents an address that's not a valid IP address. For example, if s is "1", this method returns true even though "1" (or 0.0.0.1) is not a valid IP address and you might expect this method to return false. Fixing this bug would break existing apps, so the current behavior will not be changed. Your code can avoid this behavior by ensuring that it only uses this method to parse IP addresses in dotted-decimal format.
> [!IMPORTANT]
> Note that this method accepts as valid an string value that can be parsed as an <xref:System.Int64>, and then treats that <xref:System.Int64> as the long value of an IP address in network byte order, similar to the way that the <xref:System.Net.IPAddress> constructor does. This means that this method returns `true` when the <xref:System.Int64> is parsed successfully, even if it represents an address that's not a valid IP address. For example, if `s` is "1", this method returns `true` even though "1" (or 0.0.0.1) is not a valid IP address. Fixing this bug would break existing apps, so the current behavior will not be changed. Your code can avoid this behavior by ensuring that it only uses this method to parse IP addresses in dotted-decimal format.

@davidsh
Copy link
Contributor

davidsh commented Jun 29, 2019

All of these types and methods aren't really new. What's new is that there are some overloads with ReadOnlySpan instead of other buffer types.

So, I would advise looking at that existing documentation to re-use most of the same descriptions of parameters, remarks, return values, etc. We only need small changes when new parameter types such as the ReadOnlySpan are added.

@jozkee
Copy link
Member Author

jozkee commented Jul 19, 2019

This is ready for re-review:

@mairaw @rpetrusha

@mairaw mairaw modified the milestones: June 2019, July 2019 Jul 26, 2019
@jozkee
Copy link
Member Author

jozkee commented Jul 31, 2019

@mairaw, @rpetrusha, Its been a while since I've addressed the comments on this one, can we merge it?

@mairaw
Copy link
Contributor

mairaw commented Aug 6, 2019

Taking a look now @jozkee!

@mairaw
Copy link
Contributor

mairaw commented Aug 6, 2019

@jozkee I've made some changes to the three files. Can you make sure I didn't introduce anything wrong? Also let me know if you dislike any of the changes I made. Thanks!

@mairaw mairaw added the waiting-on-feedback Indicates PRs that are waiting for feedback from SMEs before they can be merged label Aug 6, 2019
Copy link
Member Author

@jozkee jozkee left a comment

Choose a reason for hiding this comment

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

I added a few comments regarding CookieCollection.GetEnumerator, other than that, your changes looks pretty good.
Also, nice catch on CookieCollection.Remove

@jozkee
Copy link
Member Author

jozkee commented Aug 7, 2019

@mairaw Looks good to me, can we merge?

@carlossanlop
Copy link
Contributor

@mairaw thanks for your last commit to fix the broken cref. The latest build passed without warnings. Is this good to merge?

@carlossanlop carlossanlop requested a review from mairaw August 8, 2019 21:30
@carlossanlop carlossanlop added changes-addressed Indicates PRs that had all comments addressed and are awaiting for new review and removed waiting-on-feedback Indicates PRs that are waiting for feedback from SMEs before they can be merged labels Aug 8, 2019
@carlossanlop
Copy link
Contributor

@mairaw successful build with no warnings. I think it's ready to merge.

@mairaw mairaw removed changes-addressed Indicates PRs that had all comments addressed and are awaiting for new review verify-build-before-merge labels Aug 8, 2019
@mairaw mairaw merged commit 3d7e35f into dotnet:master Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Net 🏁 Release: .NET Core 3.0 :checkered_flag: Release: .NET Core 3.0 new-content Indicates PRs that contain new articles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants