From 04b02870810270109460a6876dc2757702eee06e Mon Sep 17 00:00:00 2001 From: Radek Zikmund <32671551+rzikm@users.noreply.github.com> Date: Fri, 14 Feb 2025 10:20:25 +0100 Subject: [PATCH] Update comment on return value of NetworkStream.Read* variants Fixes https://github.com/dotnet/dotnet-api-docs/issues/10925. Mentions that returns 0 when socket was closed. --- xml/System.Net.Sockets/NetworkStream.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xml/System.Net.Sockets/NetworkStream.xml b/xml/System.Net.Sockets/NetworkStream.xml index cc06499f472..f962f02deaf 100644 --- a/xml/System.Net.Sockets/NetworkStream.xml +++ b/xml/System.Net.Sockets/NetworkStream.xml @@ -1107,7 +1107,7 @@ The Close method frees both unmanaged and managed resources associated with the An that represents an asynchronous call. Handles the end of an asynchronous read. - The number of bytes read from the . + The number of bytes read from the , or 0 if the underlying socket was closed. A region of memory to store data read from the . Reads data from the and stores it to a span of bytes in memory. - The number of bytes read from the . + The number of bytes read from the , or 0 if the underlying socket was closed. The number of bytes to read from the . The number of bytes to read from the . Reads data from the and stores it to a byte array. - The number of bytes read from the . + The number of bytes read from the , or 0 if the underlying socket was closed. The buffer to write the data to. The token to monitor for cancellation requests. Reads data from the and stores it in a byte memory range as an asynchronous operation. - A that represents the asynchronous read operation. The value of its property contains the total number of bytes read into . + A that represents the asynchronous read operation. The value of its property contains the total number of bytes read into , or 0 if the underlying socket was closed. The number of bytes to read from the . The token to monitor for cancellation requests. Reads data from the and stores it to a specified range of a byte array as an asynchronous operation. - A task that represents the asynchronous read operation. The value of its property contains the total number of bytes read into . + A task that represents the asynchronous read operation. The value of its property contains the total number of bytes read into , or 0 if the underlying socket was closed.