diff --git a/xml/System.Net.Cache/HttpCacheAgeControl.xml b/xml/System.Net.Cache/HttpCacheAgeControl.xml index e37a41f810d..16ba48b1bb0 100644 --- a/xml/System.Net.Cache/HttpCacheAgeControl.xml +++ b/xml/System.Net.Cache/HttpCacheAgeControl.xml @@ -53,7 +53,7 @@ ## Examples The following code example creates a policy based on MaxAgeAndMinFresh. - + :::code language="csharp" source="~/snippets/csharp/System.Net/WebRequest/CachePolicy/example.cs" id="Snippet9"::: ]]> @@ -300,7 +300,7 @@ 0 - For internal use only. The Framework will throw an if you try to use this member. + For internal use only. An is thrown if you try to use this member. diff --git a/xml/System.Net.Cache/HttpRequestCacheLevel.xml b/xml/System.Net.Cache/HttpRequestCacheLevel.xml index eb7c6d38432..76ff4f50d5c 100644 --- a/xml/System.Net.Cache/HttpRequestCacheLevel.xml +++ b/xml/System.Net.Cache/HttpRequestCacheLevel.xml @@ -49,25 +49,15 @@ ## Remarks This enumeration is used to set the cache level specified by objects. - This `BypassCache` value is the default cache behavior specified in the machine configuration file that ships with the .NET Framework. No entries are taken from caches, added to caches, or removed from caches between the client and server. - The property is used to get or set the default cache policy for instances. The property is used to get or set the default cache policy for a instance. The property is used to get or set the cache policy for a specific request. A copy of a resource is only added to the cache if the response stream for the resource is retrieved and read to the end of the stream. So another request for the same resource could use a cached copy, depending on the default cache policy level for this request. - - -## Examples - The following code example sets the application domain's caching policy to Default. - - :::code language="csharp" source="~/snippets/csharp/System.Net/WebRequest/CachePolicy/example.cs" id="Snippet2"::: - ]]> Cache Management for Network Applications - RequestCaching Element (Network Settings) @@ -107,7 +97,7 @@ 1 - Satisfies a request by using the server. No entries are taken from caches, added to caches, or removed from caches between the client and server. No entries are taken from caches, added to caches, or removed from caches between the client and server. This is the default cache behavior specified in the machine configuration file that ships with the .NET Framework. + Satisfies a request by using the server. No entries are taken from caches, added to caches, or removed from caches between the client and server. diff --git a/xml/System.Net.Cache/HttpRequestCachePolicy.xml b/xml/System.Net.Cache/HttpRequestCachePolicy.xml index a82f85978d5..78169a27592 100644 --- a/xml/System.Net.Cache/HttpRequestCachePolicy.xml +++ b/xml/System.Net.Cache/HttpRequestCachePolicy.xml @@ -48,19 +48,12 @@ property or the application or machine configuration files. For more information, see [<requestCaching> Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/requestcaching-element-network-settings). + You can specify a default cache policy for your application by using the property. You can specify the cache policy for an individual request by using the property. Caching for Web services is not supported. - - -## Examples - The following code example creates a default cache policy for the application domain, and overrides it for a request. - - :::code language="csharp" source="~/snippets/csharp/System.Net/WebRequest/CachePolicy/example.cs" id="Snippet2"::: - ]]> Cache Management for Network Applications @@ -527,14 +520,7 @@ as their cache policy level. The property, if not `null`, determines the cache policy in effect for a request. The default policy for the application domain can be set using the property or by settings in the machine or application configuration files. For more information, see [<requestCaching> Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/requestcaching-element-network-settings). - - - -## Examples - The following code example demonstrates displaying the value of this property. - - :::code language="csharp" source="~/snippets/csharp/System.Net/WebRequest/CachePolicy/example.cs" id="Snippet11"::: + Applications typically use as their cache policy level. The property, if not `null`, determines the cache policy in effect for a request. The default policy can be set using the property. ]]> diff --git a/xml/System.Net.Cache/RequestCacheLevel.xml b/xml/System.Net.Cache/RequestCacheLevel.xml index 0dad264554d..a9983b43f33 100644 --- a/xml/System.Net.Cache/RequestCacheLevel.xml +++ b/xml/System.Net.Cache/RequestCacheLevel.xml @@ -49,8 +49,6 @@ ## Remarks Members of this enumeration are used to initialize objects. The current setting for a object is available in the property. - This value is the default cache behavior specified in the machine configuration file that ships with the .NET Framework. No entries are taken from caches, added to caches, or removed from caches between the client and server. - The property is used to get or set the default cache policy for instances. The property is used to get or set the default cache policy for a instances. The property is used to get or set the cache policy for a specific request. If the cache behavior is `CacheIfAvailable` or `Revalidate`, a copy of a requested resource is only added to the cache if the response stream for the resource is retrieved and read to the end of the stream. With `CacheIfAvailable`, subsequent requests for the same resource would use a cached copy. With `Revalidate`, subsequent requests for the same resource would use a cached copy if the timestamp for the cached resource is the same as the timestamp of the resource on the server. @@ -67,7 +65,6 @@ A copy of a resource is only added to the cache if the response stream for the r Cache Management for Network Applications - RequestCaching Element (Network Settings) @@ -107,7 +104,7 @@ A copy of a resource is only added to the cache if the response stream for the r 1 - Satisfies a request by using the server. No entries are taken from caches, added to caches, or removed from caches between the client and server. This is the default cache behavior specified in the machine configuration file that ships with the .NET Framework. + Satisfies a request by using the server. No entries are taken from caches, added to caches, or removed from caches between the client and server. diff --git a/xml/System.Net.Cache/RequestCachePolicy.xml b/xml/System.Net.Cache/RequestCachePolicy.xml index d59afeaf0e9..61a85096d39 100644 --- a/xml/System.Net.Cache/RequestCachePolicy.xml +++ b/xml/System.Net.Cache/RequestCachePolicy.xml @@ -48,14 +48,12 @@ property or the application or machine configuration files. For more information, see [<requestCaching> Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/requestcaching-element-network-settings). + You can specify a default cache policy for your application by using the property. You can specify the cache policy for an individual request by using the property. Caching for Web services is not supported. - - ## Examples The following code example creates a policy with set to , and uses it to set the cache policy of a . @@ -231,14 +229,7 @@ ## Remarks Applications typically use as their cache policy level. Using the level, the effective cache policy is determined by the current cache policy and the age of the content in the cache. The property, if not `null`, determines the cache policy in effect for a request. - The default policy for the application domain can be set using the or the application or machine configuration file. For more information, see [<requestCaching> Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/requestcaching-element-network-settings). - - - -## Examples - The following code example creates a policy and sends a request. - - :::code language="csharp" source="~/snippets/csharp/System.Net/WebRequest/CachePolicy/example.cs" id="Snippet13"::: +You can set the default policy using the property. ]]> diff --git a/xml/System.Net.Http/HttpClient.xml b/xml/System.Net.Http/HttpClient.xml index a1003059876..a9a5f8735b8 100644 --- a/xml/System.Net.Http/HttpClient.xml +++ b/xml/System.Net.Http/HttpClient.xml @@ -589,11 +589,8 @@ This property has no effect on any of the object will complete after the whole response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations: -> -> - that nests a is thrown on .NET 5 and later versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - is thrown on all applicable .NET Framework versions. +> In case of timeout, that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The request message was already sent by the instance. @@ -605,12 +602,8 @@ The is not an absolute URI. -or- is not set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by . - --or- - -.NET Framework only: The request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by . + The request failed due to timeout. @@ -666,11 +659,8 @@ The is not an absolute URI. This operation doesn't block. The returned object will complete after the whole response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations: -> -> - that nests a is thrown on .NET 5 and later versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - is thrown on all applicable .NET Framework versions. +> In case of timeout, that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The request message was already sent by the instance. @@ -682,12 +672,8 @@ The is not an absolute URI. -or- is not set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: the request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by + The request failed due to timeout. @@ -749,11 +735,8 @@ The is not an absolute URI. This operation doesn't block. The returned object will complete after the whole response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> -> - that nests a is thrown on .NET 5 and later versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - is thrown on all applicable .NET Framework versions. +> In case of timeout, that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The request message was already sent by the instance. @@ -765,16 +748,12 @@ The is not an absolute URI. -or- is not set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: the request timed out. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by The cancellation token was canceled. This exception is stored into the returned task. -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -832,11 +811,8 @@ The is not an absolute URI. This operation doesn't block. The returned object will complete after the whole response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. +> In case of timeout, that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. ]]> The request message was already sent by the instance. @@ -848,16 +824,12 @@ The is not an absolute URI. -or- is not set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: the request timed out. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by The cancellation token was canceled. This exception is stored into the returned task. -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -988,19 +960,13 @@ The is not an absolute URI. This operation doesn't block. The returned object will complete after the whole response (including content) is read. The behavior is the same as if has been explicitly specified. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: the request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by + The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -1057,19 +1023,13 @@ The is not an absolute URI. This operation doesn't block. The returned object will complete after the whole response (including content) is read. The behavior is the same as if has been explicitly specified. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: the request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by + The request failed due to timeout. @@ -1131,15 +1091,13 @@ The is not an absolute URI. This operation doesn't block. The returned object will complete based on the `completionOption` parameter after the part or all of the response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - .NET Core and .NET 5 and later only: The request failed due to timeout. + The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -1202,24 +1160,18 @@ The is not an absolute URI. This operation doesn't block. The returned object will complete after the whole response (including content) is read. The behavior is the same as if has been explicitly specified. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: the request timed out. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by The provided request URI is not valid relative or absolute URI. The cancellation token was canceled. This exception is stored into the returned task. -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -1277,19 +1229,13 @@ The is not an absolute URI. This operation doesn't block. The returned object will complete based on the `completionOption` parameter after the part or all of the response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: the request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by + The request failed due to timeout. @@ -1347,23 +1293,17 @@ The is not an absolute URI. This operation doesn't block. The returned object will complete after the whole response (including content) is read. The behavior is the same as if has been explicitly specified. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. - TThe request failed due to an issue getting an HTTP response such as network connectivity, DNS failure or server certificate validation. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: the request timed out. + TThe request failed due to an issue getting an HTTP response such as network connectivity, DNS failure or server certificate validation. On .NET 8 and later versions, the reason is indicated by The cancellation token was canceled. This exception is stored into the returned task. -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -1427,24 +1367,18 @@ The is not an absolute URI. This operation doesn't block. The returned object will complete based on the `completionOption` parameter after the part or all of the response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: the request timed out. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by The provided request URI is not valid relative or absolute URI. The cancellation token was canceled. This exception is stored into the returned task. -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -1504,23 +1438,17 @@ The is not an absolute URI. This operation doesn't block. The returned object will complete based on the `completionOption` parameter after the part or all of the response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: the request timed out. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by The cancellation token was canceled. This exception is stored into the returned task. -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -1601,10 +1529,8 @@ The is not an absolute URI. In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. @@ -1612,12 +1538,8 @@ In some scenarios, you might need more control over which status codes are consi -or- -The response status code was outside of the range of 200-299 (which indicate success according to the standard). - --or- - -.NET Framework only: The request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. +The response status code was outside of the range of 200-299 (which indicate success according to the standard). + The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -1676,10 +1598,7 @@ The response status code was outside of the range of 200-299 (which indicate suc In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] -> In case of a timeout: -> - .NET Framework throws a . -> - .NET Core throws a without any inner exception. -> - .NET 5 and later versions throw a that nests a . +> In case of a timeout, that nests a is thrown. ]]> @@ -1688,12 +1607,8 @@ In some scenarios, you might need more control over which status codes are consi -or- -The response status code was outside of the range of 200-299 (which indicate success according to the standard). - --or- - -.NET Framework only: The request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. +The response status code was outside of the range of 200-299 (which indicate success according to the standard). + The request failed due to timeout. @@ -1749,10 +1664,7 @@ The response status code was outside of the range of 200-299 (which indicate suc In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] -> In case of a timeout: -> - .NET Framework throws a . -> - .NET Core throws a without any inner exception. -> - .NET 5 and later versions throw a that nests a . +> In case of a timeout, that nests a is thrown. ]]> @@ -1766,7 +1678,7 @@ The response status code was outside of the range of 200-299 (which indicate suc -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -1818,10 +1730,7 @@ The response status code was outside of the range of 200-299 (which indicate suc In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] -> In case of a timeout: -> - .NET Framework throws a . -> - .NET Core throws a without any inner exception. -> - .NET 5 and later versions throw a that nests a . +> In case of a timeout, that nests a is thrown. ]]> @@ -1835,7 +1744,7 @@ The response status code was outside of the range of 200-299 (which indicate suc -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -1916,10 +1825,8 @@ The response status code was outside of the range of 200-299 (which indicate suc In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] -> In case of a timeout: -> - .NET Framework throws a . -> - .NET Core throws a without any inner exception. -> - .NET 5 and later versions throw a that nests a . +> In case of a timeout, that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. @@ -1927,12 +1834,8 @@ In some scenarios, you might need more control over which status codes are consi -or- -The response status code was outside of the range of 200-299 (which indicate success according to the standard). - --or- - -.NET Framework only: The request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. +The response status code was outside of the range of 200-299 (which indicate success according to the standard). + The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -1991,10 +1894,8 @@ The response status code was outside of the range of 200-299 (which indicate suc In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] -> In case of a timeout: -> - .NET Framework throws a . -> - .NET Core throws a without any inner exception. -> - .NET 5 and later versions throw a that nests a . +> In case of a timeout, that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. @@ -2002,12 +1903,8 @@ In some scenarios, you might need more control over which status codes are consi -or- -The response status code was outside of the range of 200-299 (which indicate success according to the standard). - --or- - -.NET Framework only: The request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. +The response status code was outside of the range of 200-299 (which indicate success according to the standard). + The request failed due to timeout. @@ -2063,17 +1960,15 @@ The response status code was outside of the range of 200-299 (which indicate suc In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] -> In case of a timeout: -> - .NET Framework throws a . -> - .NET Core throws an without any inner exception. -> - .NET 5 and later versions throw an that nests a . +> In case of a timeout: an that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The cancellation token was canceled. This exception is stored into the returned task. -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. The is . The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by @@ -2132,10 +2027,8 @@ The response status code was outside of the range of 200-299 (which indicate suc In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] -> In case of a timeout: -> - .NET Framework throws a . -> - .NET Core throws a without any inner exception. -> - .NET 5 and later versions throw a that nests a . +> In case of a timeout, an that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is . @@ -2148,7 +2041,7 @@ The response status code was outside of the range of 200-299 (which indicate suc -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -2229,10 +2122,8 @@ The response status code was outside of the range of 200-299 (which indicate suc In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] -> In case of a timeout: -> - .NET Framework throws a . -> - .NET Core throws a without any inner exception. -> - .NET 5 and later versions throw a that nests a . +> In case of a timeout, an that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. @@ -2240,12 +2131,8 @@ In some scenarios, you might need more control over which status codes are consi -or- -The response status code was outside of the range of 200-299 (which indicate success according to the standard). - --or- - -.NET Framework only: The request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. +The response status code was outside of the range of 200-299 (which indicate success according to the standard). + The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -2304,10 +2191,8 @@ The response status code was outside of the range of 200-299 (which indicate suc In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] -> In case of a timeout: -> - .NET Framework throws a . -> - .NET Core throws a without any inner exception. -> - .NET 5 and later versions throw a that nests a . +> In case of a timeout, an that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. @@ -2315,12 +2200,8 @@ In some scenarios, you might need more control over which status codes are consi -or- -The response status code was outside of the range of 200-299 (which indicate success according to the standard). - --or- - -.NET Framework only: The request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. +The response status code was outside of the range of 200-299 (which indicate success according to the standard). + The request failed due to timeout. @@ -2376,10 +2257,8 @@ The response status code was outside of the range of 200-299 (which indicate suc In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] -> In case of a timeout: -> - .NET Framework throws a . -> - .NET Core throws a without any inner exception. -> - .NET 5 and later versions throw a that nests a . +> In case of a timeout, an that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is . @@ -2393,7 +2272,7 @@ The response status code was outside of the range of 200-299 (which indicate suc -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -2445,10 +2324,8 @@ The response status code was outside of the range of 200-299 (which indicate suc In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] -> In case of a timeout: -> - .NET Framework throws a . -> - .NET Core throws a without any inner exception. -> - .NET 5 and later versions throw a that nests a . +> In case of a timeout, an that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is . @@ -2461,7 +2338,7 @@ The response status code was outside of the range of 200-299 (which indicate suc -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -2843,19 +2720,13 @@ The size specified is greater than the maximum allowed buffer size. This operation doesn't block. The returned object will complete after the whole response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, an that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: The request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by + The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -2914,19 +2785,13 @@ The size specified is greater than the maximum allowed buffer size. This operation doesn't block. The returned object will complete after the whole response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, an that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: The request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by + The request failed due to timeout. @@ -2993,24 +2858,18 @@ The size specified is greater than the maximum allowed buffer size. This operation doesn't block. The returned object will complete after the whole response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, an that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: The request timed out. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by The provided request URI is not valid relative or absolute URI. The cancellation token was canceled. This exception is stored into the returned task. -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -3070,23 +2929,17 @@ The size specified is greater than the maximum allowed buffer size. This operation doesn't block. The returned object will complete after the whole response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, an that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: The request timed out. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by The cancellation token was canceled. This exception is stored into the returned task. -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -3170,19 +3023,13 @@ The size specified is greater than the maximum allowed buffer size. This operation doesn't block. The returned object will complete after the whole response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, an that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: The request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by + The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -3241,19 +3088,13 @@ The size specified is greater than the maximum allowed buffer size. This operation doesn't block. The returned object will complete after the whole response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, an that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: The request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by + The request failed due to timeout. @@ -3320,24 +3161,18 @@ The size specified is greater than the maximum allowed buffer size. This operation doesn't block. The returned object will complete after the whole response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, an that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: The request timed out. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by The provided request URI is not valid relative or absolute URI. The cancellation token was canceled. This exception is stored into the returned task. -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -3397,23 +3232,17 @@ The size specified is greater than the maximum allowed buffer size. This operation doesn't block. The returned object will complete after the whole response (including content) is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, an that nests a is thrown. (On .NET Core versions, without any inner exception is thrown.) + ]]> The is not an absolute URI and isn't set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: The request timed out. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by The cancellation token was canceled. This exception is stored into the returned task. -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -3618,7 +3447,7 @@ The custom does not override -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -3691,7 +3520,7 @@ The custom does not override -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -3758,10 +3587,7 @@ The custom does not override This operation doesn't block. The returned object will complete once the entire response including content is read. The behavior is the same as if has been explicitly specified. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, an that nests a is thrown. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . @@ -3769,12 +3595,8 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: The request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by + The request failed due to timeout. @@ -3824,10 +3646,7 @@ This method stores in the task it returns all non-usage exceptions that the meth This operation doesn't block. Depending on the value of the `completionOption` parameter, the returned object will complete as soon as a response is available or the entire response including content is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, an that nests a is thrown. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . @@ -3835,12 +3654,8 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: The request timed out. - .NET Core and .NET 5 and later only: The request failed due to timeout. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by + The request failed due to timeout. @@ -3890,10 +3705,7 @@ This method stores in the task it returns all non-usage exceptions that the meth This operation doesn't block. The returned object will complete once the entire response including content is read. The behavior is the same as if has been explicitly specified. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, an that nests a is thrown. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . @@ -3901,16 +3713,12 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: The request timed out. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by The cancellation token was canceled. This exception is stored into the returned task. -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. @@ -3962,10 +3770,7 @@ This method stores in the task it returns all non-usage exceptions that the meth This operation doesn't block. Depending on the value of the `completionOption` parameter, the returned object will complete as soon as a response is available or the entire response including content is read. > [!NOTE] -> In case of timeout, different exceptions are thrown on different .NET implementations. -> - is thrown on all applicable .NET Framework versions. -> - without any inner exception is thrown on all applicable .NET Core versions. -> - that nests a is thrown on .NET 5 and later versions. +> In case of timeout, an that nests a is thrown. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . @@ -3973,16 +3778,12 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by - --or- - -.NET Framework only: the request timed out. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by The cancellation token was canceled. This exception is stored into the returned task. -or- -.NET Core and .NET 5 and later only: The request failed due to timeout. +The request failed due to timeout. diff --git a/xml/System.Net.Http/HttpClientHandler.xml b/xml/System.Net.Http/HttpClientHandler.xml index 2cac07b770e..7bb75c963e0 100644 --- a/xml/System.Net.Http/HttpClientHandler.xml +++ b/xml/System.Net.Http/HttpClientHandler.xml @@ -129,15 +129,14 @@ ## Remarks Set to `true` if you want the handler to automatically follow HTTP redirection headers to the new location of the resource. The maximum number of redirections to follow is set by the property. - If is set to `false`, all HTTP responses with an HTTP status code from 300 to 399 are returned to the application. + If is set to `false`, all HTTP responses with an HTTP status code from 300 to 399 are returned to the application. The Authorization header is cleared on auto-redirects and the handler automatically tries to re-authenticate to the redirected location. No other headers are cleared. In practice, this means that an application can't put custom authentication information into the Authorization header if it is possible to encounter redirection. Instead, the application must implement and register a custom authentication module. If you are using cookies by specifically adding them to the collection, these are not cleared when a redirect is followed, as the handler has no way of knowing what domain a cookie is allowed for. If you want to mimic browser behavior, use the class which allows you to specify the target domain for a cookie. > [!NOTE] -> On .NET Core and .NET 5 and later versions, setting to `true` **does not enable** automatic redirection to an HTTP URI from an HTTPS URI. -> Such (secure to insecure) redirections are only followed on .NET Framework. +> Setting to `true` **does not enable** automatic redirection to an HTTP URI from an HTTPS URI. ]]> @@ -192,9 +191,6 @@ Setting automatic decompression to anything other than will result in adding `Accept-Encoding` header with the set values into every outgoing . - -For the .NET Framework 4.x `System.Net.Http` binary in the Global Assembly Cache (GAC), the default value is . - ]]> @@ -241,7 +237,6 @@ For the .NET Framework 4.x `System.Net.Http` binary in the Global Assembly Cache if the certificate revocation list is checked; otherwise, . To be added. - .NET Framework 4.7.1 only: This property is not implemented. @@ -330,7 +325,7 @@ For the .NET Framework 4.x `System.Net.Http` binary in the Global Assembly Cache ## Remarks -On .NET Core, the key usage attribute on the X509 certificate, if present, is required to have the value "Digital Signature" in order to be used when sending the request. +The key usage attribute on the X509 certificate, if present, is required to have the value "Digital Signature" in order to be used when sending the request. ]]> @@ -1210,7 +1205,6 @@ handler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousA Gets or sets the TLS/SSL protocols used by the objects managed by the HttpClientHandler object. A bitwise combination of the enumeration values that specify the TLS/SSL protocols. To be added. - .NET Framework 4.7.1 only: This property is not implemented. diff --git a/xml/System.Net.Http/HttpResponseMessage.xml b/xml/System.Net.Http/HttpResponseMessage.xml index 6fe1503ce54..8f3687ffcf1 100644 --- a/xml/System.Net.Http/HttpResponseMessage.xml +++ b/xml/System.Net.Http/HttpResponseMessage.xml @@ -354,10 +354,8 @@ When the `disposing` parameter is `true`, this method releases all resources hel ## Remarks The method throws an if is outside of the range 200-299 (the range of status codes indicating success according to the standard). - - In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. - In .NET Framework, if the is not `null`, this method also calls to free managed and unmanaged resources. Starting with .NET Core 3.0, the content is not disposed. + In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. ]]> diff --git a/xml/System.Net.Http/SocketsHttpHandler.xml b/xml/System.Net.Http/SocketsHttpHandler.xml index 0b08b1a988a..068255b8ec9 100644 --- a/xml/System.Net.Http/SocketsHttpHandler.xml +++ b/xml/System.Net.Http/SocketsHttpHandler.xml @@ -949,7 +949,7 @@ For example, if the value is 64, then 65,536 bytes are allowed for the maximum r Gets or sets how long a connection can be idle in the pool to be considered reusable. - The maximum idle time for a connection in the pool. The default value for this property is 1 minute in .NET 6 and later versions; the default value is 2 minutes in .NET Core and .NET 5 + The maximum idle time for a connection in the pool. The default value for this property is 1 minute in .NET 6 and later versions; the default value is 2 minutes in .NET Core and .NET 5. To be added. The value specified is less than and is not . An operation has already been started on the current instance. diff --git a/xml/System.Net.Http/WinHttpHandler.xml b/xml/System.Net.Http/WinHttpHandler.xml index b31b069c32f..3134067bd77 100644 --- a/xml/System.Net.Http/WinHttpHandler.xml +++ b/xml/System.Net.Http/WinHttpHandler.xml @@ -60,8 +60,7 @@ Starting in .NET 5, is no longer included Starting with version 6.0.0, supports trailing headers, also known as trailers ([RFC 7230 - 4.1.2. Chunked Trailer Part](https://tools.ietf.org/html/rfc7230#section-4.1.2)). -- On .NET Standard 2.1 and .NET 8 or later, trailers are added to . -- On .NET Framework, trailers are added to a well-known property in on the request object corresponding to the response (). The name of the property is `__ResponseTrailers`, the type of the property value is . +Trailers are added to . Trailer support is implemented via the `WINHTTP_QUERY_FLAG_TRAILERS` [Query Info Flag](/windows/win32/winhttp/query-info-flags) which has been introduced in Windows 11, version 21H2 (10.0; Build 22000). On Windows systems where `WINHTTP_QUERY_FLAG_TRAILERS` is unsupported, trailers are ignored. diff --git a/xml/System.Net.Mail/MailMessage.xml b/xml/System.Net.Mail/MailMessage.xml index 235f7fde750..7386748805a 100644 --- a/xml/System.Net.Mail/MailMessage.xml +++ b/xml/System.Net.Mail/MailMessage.xml @@ -162,14 +162,7 @@ Initializes an empty instance of the class. - - - + To be added. @@ -691,9 +684,7 @@ ## Remarks The value specified for the property sets the character set field in the Content-Type header. The default character set is `"us-ascii"`. - If you set the property to , , or , the Framework selects a of for this . - - + If you set the property to , , or , .NET selects a of for this . ## Examples The following code example demonstrates creating a mail message that uses UTF8 encoding. diff --git a/xml/System.Net.Mail/SmtpAccess.xml b/xml/System.Net.Mail/SmtpAccess.xml index 342a6fa327e..95082543b08 100644 --- a/xml/System.Net.Mail/SmtpAccess.xml +++ b/xml/System.Net.Mail/SmtpAccess.xml @@ -36,21 +36,7 @@ Specifies the level of access allowed to a Simple Mail Transport Protocol (SMTP) server. - - enumeration is used by the and classes to specify a level of access to an SMTP host computer. The class demands an when sending electronic mail to the SMTP host for delivery. - - - -## Examples - The following code example uses the enumeration to create a permission object. - - :::code language="csharp" source="~/snippets/csharp/System.Net.Mail/SmtpAccess/Overview/mailpermissions.cs" id="Snippet1"::: - - ]]> - + To be added. diff --git a/xml/System.Net.Mail/SmtpClient.xml b/xml/System.Net.Mail/SmtpClient.xml index 70e41926ae6..9e65fa7273b 100644 --- a/xml/System.Net.Mail/SmtpClient.xml +++ b/xml/System.Net.Mail/SmtpClient.xml @@ -66,12 +66,6 @@ The `SmtpClient` class is used to send email to an SMTP server for delivery. The > [!IMPORTANT] > We don't recommend that you use the `SmtpClient` class for new development because `SmtpClient` doesn't support many modern protocols. Use [MailKit](https://github.com/jstedfast/MailKit) or other libraries instead. For more information, see [SmtpClient shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0005.md). -The `SmtpClient` class is: - -- Included in .NET Standard 2.0 and later versions and therefore must be part of any .NET implementation that supports those versions. -- Present and can be used in .NET Framework 4 through .NET Framework 4.8. -- Usable in .NET (Core), but its use isn't recommended. - The classes shown in the following table are used to construct email messages that can be sent using . | Class | Description | @@ -90,7 +84,7 @@ The classes shown in the following table are used to construct email messages th To include an attachment with an email message, first create the attachment by using the class, and then add it to the message by using the property. Depending on the email reader used by the recipients and the file type of the attachment, some recipients might not be able to read the attachment. For clients that cannot display the attachment in its original form, you can specify alternate views by using the property. - In .NET Framework, you can use the application or machine configuration files to specify default host, port, and credentials values for all objects. For more information, see [<mailSettings> Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/mailsettings-element-network-settings). .NET Core does not support setting defaults. As a workaround, you must set the relevant properties on directly. +To specify host, port, and credentials values for all objects, set the relevant properties on directly. To send the email message and block while waiting for the email to be transmitted to the SMTP server, use one of the synchronous methods. To allow your program's main thread to continue executing while the email is transmitted, use one of the asynchronous methods. The event is raised when a operation completes. To receive this event, you must add a delegate to . The delegate must reference a callback method that handles notification of events. To cancel an asynchronous email transmission, use the method. @@ -117,10 +111,6 @@ The following code example demonstrates sending an email message asynchronously. ]]> - Network Programming in the .NET Framework - Network Programming Samples - Network Tracing in the .NET Framework - Security in Network Programming @@ -166,24 +156,8 @@ The following code example demonstrates sending an email message asynchronously. - Initializes a new instance of the class by using configuration file settings. - - , , and properties for the new by using the settings in the application or machine configuration files. For more information, see [<mailSettings> Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/mailsettings-element-network-settings). - - - -## Examples - The following code example demonstrates sending an email message. - - :::code language="csharp" source="~/snippets/csharp/System.Net.Mail/Attachment/Overview/mail.cs" id="Snippet4"::: - - For an example of the \ node in the application or machine configuration file, see [<mailSettings> Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/mailsettings-element-network-settings). - - ]]> - + Initializes a new instance of the class using the default port. + To be added. @@ -225,23 +199,7 @@ The following code example demonstrates sending an email message asynchronously. A that contains the name or IP address of the host computer used for SMTP transactions. Initializes a new instance of the class that sends email by using the specified SMTP server. - - property. The and properties are initialized by using the settings in the application or machine configuration files. If `host` is `null` or equal to , is initialized using the settings in the application or machine configuration files. - - For more information about using the application and machine configuration files, see [<mailSettings> Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/mailsettings-element-network-settings). If information is specified using constructors or properties, this information overrides the configuration file settings. - - - -## Examples - The following code example demonstrates calling this constructor. - - :::code language="csharp" source="~/snippets/csharp/System.Net.Mail/Attachment/Overview/mail.cs" id="Snippet3"::: - - ]]> - + To be added. @@ -285,23 +243,7 @@ The following code example demonstrates sending an email message asynchronously. A that contains the name or IP address of the host used for SMTP transactions. An greater than zero that contains the port to be used on . Initializes a new instance of the class that sends email by using the specified SMTP server and port. - - and properties, respectively. If `host` is `null` or equal to , is initialized using the settings in the application or machine configuration files. If `port` is zero, is initialized using the settings in the application or machine configuration files. The property is initialized using the settings in the application or machine configuration files. - - For more information about using the application and machine configuration files, see [<mailSettings> Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/mailsettings-element-network-settings). If information is specified using constructors or properties, this information overrides the configuration file settings. - - - -## Examples - The following code example demonstrates calling this constructor. - - :::code language="csharp" source="~/snippets/csharp/System.Net.Mail/Attachment/Overview/mail.cs" id="Snippet1"::: - - ]]> - + To be added. cannot be less than zero. @@ -348,7 +290,7 @@ The following code example demonstrates sending an email message asynchronously. System.Security.Cryptography.X509Certificates.X509CertificateCollection - Specify which certificates should be used to establish the Secure Sockets Layer (SSL) connection. + Gets the certificates that should be used to establish the Secure Sockets Layer (SSL) connection. An , holding one or more client certificates. The default value is derived from the mail configuration attributes in a configuration file. [!NOTE] -> The Framework caches SSL sessions as they are created and attempts to reuse a cached session for a new request, if possible. When attempting to reuse an SSL session, the Framework uses the first element of (if there is one), or tries to reuse an anonymous sessions if is empty. - - +> .NET caches SSL sessions as they are created and attempts to reuse a cached session for a new request, if possible. When attempting to reuse an SSL session, .NET uses the first element of (if there is one), or tries to reuse an anonymous sessions if is empty. ## Examples The following code example establishes an SSL connection with the SMTP server and uses the connection to send an email. @@ -368,7 +308,6 @@ The following code example demonstrates sending an email message asynchronously. ]]> - MailSettings Element (Network Settings) @@ -409,19 +348,15 @@ The following code example demonstrates sending an email message asynchronously. Gets or sets the credentials used to authenticate the sender. - An that represents the credentials to use for authentication; or if no credentials have been specified. + The credentials to use for authentication; or if no credentials have been specified. to `true` instead of setting this property. If the property is set to `false,` then the value set in the property will be used for the credentials when connecting to the server. If the property is set to `false` and the property has not been set, then mail is sent to the server anonymously. - Credentials information can also be specified using the application and machine configuration files. For more information, see [<mailSettings> Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/mailsettings-element-network-settings). If information is specified using the property, this information overrides the configuration file settings. - > [!CAUTION] -> If you provide credentials for basic authentication, they are sent to the server in clear text. This can present a security issue because your credentials can be seen, and then used by others. - - +> If you provide credentials for basic authentication, they are sent to the server in clear text. This can present a security issue because your credentials can be seen and used by others. ## Examples The following code example demonstrates setting the credentials used to send an email. @@ -527,8 +462,6 @@ The following code example demonstrates sending an email message asynchronously. ]]> - <mailSettings> Element (Network Settings) - <smtp> Element (Network Settings) @@ -755,9 +688,6 @@ The following code example demonstrates sending an email message asynchronously. ]]> - <mailSettings> Element (Network Settings) - <smtp> Element (Network Settings) - <network> Element (Network Settings) @@ -799,30 +729,11 @@ The following code example demonstrates sending an email message asynchronously. Gets or sets the name or IP address of the host used for SMTP transactions. A that contains the name or IP address of the computer to use for SMTP transactions. - - property can also be set using constructors or the application or machine configuration file. For more information, see [<mailSettings> Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/mailsettings-element-network-settings). - - If information is specified using this property, this information overrides the configuration file settings. - - - -## Examples - The following code example demonstrates sending an email message by using the host and port specified in an application configuration file. - - :::code language="csharp" source="~/snippets/csharp/System.Net.Mail/Attachment/Overview/mail.cs" id="Snippet7"::: - - ]]> - + To be added. The value specified for a set operation is . The value specified for a set operation is equal to (""). You cannot change the value of this property when an email is being sent. - mailSettings for system.net - <smtp> Element (Network Settings) - <network> Element (Network Settings) @@ -930,8 +841,6 @@ The following code example demonstrates sending an email message asynchronously. ]]> - <mailSettings> Element (Network Settings) - <smtp> Element (Network Settings) @@ -972,27 +881,10 @@ The following code example demonstrates sending an email message asynchronously. Gets or sets the port used for SMTP transactions. An that contains the port number on the SMTP host. The default value is 25. - - property can also be set using constructors or the application or machine configuration file. For more information about using configuration files, see [<mailSettings> Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/mailsettings-element-network-settings). If information is specified using this property, this information overrides the configuration file settings. - - - -## Examples - The following code example demonstrates sending an email message by using the host and port specified in an application configuration file. - - :::code language="csharp" source="~/snippets/csharp/System.Net.Mail/Attachment/Overview/mail.cs" id="Snippet7"::: - - ]]> - + To be added. The value specified for a set operation is less than or equal to zero. You cannot change the value of this property when an email is being sent. - mailSettings for system.net - <smtp> Element (Network Settings) - <network> Element (Network Settings) @@ -2138,7 +2030,6 @@ The following code example demonstrates sending an email message asynchronously. -or- is zero. - connectionManagement Element (Network Settings) Managing Connections @@ -2192,9 +2083,6 @@ The following code example demonstrates sending an email message asynchronously. ]]> Integrated Windows Authentication with Extended Protection - <mailSettings> Element (Network Settings) - <smtp> Element (Network Settings) - <network> Element (Network Settings) @@ -2292,7 +2180,7 @@ The following code example demonstrates sending an email message asynchronously. System.Boolean - Gets or sets a value that controls whether the are sent with requests. + Gets or sets a value that indicates whether the are sent with requests. if the default credentials are used; otherwise . The default value is . @@ -2301,14 +2189,10 @@ The following code example demonstrates sending an email message asynchronously. ## Remarks Some SMTP servers require that the client be authenticated before the server sends email on its behalf. Set this property to `true` when this object should, if requested by the server, authenticate using the default credentials of the currently logged on user. For client applications, this is the desired behavior in most scenarios. - Credentials information can also be specified using the application and machine configuration files. For more information, see [<mailSettings> Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/mailsettings-element-network-settings). - If the property is set to `false,` then the value set in the property will be used for the credentials when connecting to the server. If the property is set to `false` and the property has not been set, then mail is sent to the server anonymously. > [!CAUTION] -> If you provide credentials for basic authentication, they are sent to the server in clear text. This can present a security issue because your credentials can be seen, and then used by others. - - +> If you provide credentials for basic authentication, they are sent to the server in clear text. This can present a security issue because your credentials can be seen and used by others. ## Examples The following code example demonstrates using this property. diff --git a/xml/System.Net.Mail/SmtpPermission.xml b/xml/System.Net.Mail/SmtpPermission.xml index 5c1ad293276..fbe36f304f9 100644 --- a/xml/System.Net.Mail/SmtpPermission.xml +++ b/xml/System.Net.Mail/SmtpPermission.xml @@ -49,10 +49,6 @@ [!INCLUDE[cas-deprecated](~/includes/cas-deprecated.md)] - The and classes control access to SMTP host computers. The class demands an when sending electronic mail to the SMTP host for delivery. - - The enumeration specifies the level of access controlled by an instance of this permission. - ]]> @@ -98,14 +94,7 @@ if the new permission is unrestricted; otherwise, . Initializes a new instance of the class with the specified state. - - access to SMTP servers. If unrestricted is `false`, the permission controls access. - - ]]> - + To be added. @@ -139,14 +128,7 @@ One of the values. Initializes a new instance of the class using the specified access level. - - - + To be added. @@ -180,14 +162,7 @@ One of the values. Initializes a new instance of the class using the specified permission state value. - - - + To be added. @@ -258,14 +233,7 @@ One of the values. Adds the specified access level value to the permission. - - - + To be added. @@ -300,14 +268,7 @@ Creates and returns an identical copy of the current permission. An that is identical to the current permission. - - - + To be added. @@ -344,14 +305,7 @@ The XML encoding to use to set the state of the current permission. Sets the state of the permission using the specified XML encoding. - - - + To be added. does not describe an object. @@ -397,14 +351,7 @@ An to intersect with the current permission. It must be of the same type as the current permission. Creates and returns a permission that is the intersection of the current permission and the specified permission. An that represents the intersection of the current permission and the specified permission. Returns if the intersection is empty or is . - - - + To be added. is not an . @@ -445,14 +392,7 @@ Returns a value indicating whether the current permission is a subset of the specified permission. if the current permission is a subset of the specified permission; otherwise, . - - - + To be added. is not an . @@ -493,14 +433,7 @@ Returns a value indicating whether the current permission is unrestricted. if the current permission is unrestricted; otherwise, . - - - + To be added. @@ -535,14 +468,7 @@ Creates an XML encoding of the state of the permission. A that contains an XML encoding of the current permission. - - - + To be added. @@ -580,14 +506,7 @@ An to combine with the current permission. Creates a permission that is the union of the current permission and the specified permission. A new permission that represents the union of the current permission and the specified permission. - - method returns a permission that represents all the states represented by both the current permission and the specified permission. Any demand that passes either permission passes their union. - - ]]> - + To be added. is not an . diff --git a/xml/System.Net.Mail/SmtpPermissionAttribute.xml b/xml/System.Net.Mail/SmtpPermissionAttribute.xml index b157c7c20c8..8eb0109d39f 100644 --- a/xml/System.Net.Mail/SmtpPermissionAttribute.xml +++ b/xml/System.Net.Mail/SmtpPermissionAttribute.xml @@ -49,10 +49,6 @@ [!INCLUDE[cas-deprecated](~/includes/cas-deprecated.md)] - The and classes control access to SMTP host computers. The class demands an when sending electronic mail to the SMTP host for delivery. - - The enumeration specifies the level of access controlled by an instance of this permission. - ]]> @@ -88,14 +84,7 @@ One of the values that specifies the permission behavior. Initializes a new instance of the class. - - - + To be added. is not a valid . @@ -131,14 +120,7 @@ Gets or sets the level of access to SMTP servers controlled by the attribute. A value. Valid values are "Connect" and "None". - - method will throw an when called by the system. - - ]]> - + To be added. @@ -173,16 +155,7 @@ Creates a permission object that can be stored with the in an assembly's metadata. An instance. - - - + To be added. diff --git a/xml/System.Net.NetworkInformation/NetworkChange.xml b/xml/System.Net.NetworkInformation/NetworkChange.xml index 43297d0dc72..dfd931921f5 100644 --- a/xml/System.Net.NetworkInformation/NetworkChange.xml +++ b/xml/System.Net.NetworkInformation/NetworkChange.xml @@ -67,7 +67,7 @@ ## Examples The following code example listens for address changes and displays the status of network interfaces when a event occurs. - + :::code language="csharp" source="~/snippets/csharp/System.Net.NetworkInformation/NetworkChange/Overview/changed.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Net.NetworkInformation/NetworkChange/Overview/changed.vb" id="Snippet1"::: diff --git a/xml/System.Net.NetworkInformation/NetworkInformationPermission.xml b/xml/System.Net.NetworkInformation/NetworkInformationPermission.xml index 29603e8d3f6..31dcba35f9d 100644 --- a/xml/System.Net.NetworkInformation/NetworkInformationPermission.xml +++ b/xml/System.Net.NetworkInformation/NetworkInformationPermission.xml @@ -50,10 +50,6 @@ [!INCLUDE[cas-deprecated](~/includes/cas-deprecated.md)] - This permission is used to secure data returned by the classes in the namespace. - - For declarative security, use the class. - ]]> @@ -100,14 +96,7 @@ One of the values. Initializes a new instance of the class using the specified value. - - - + To be added. @@ -142,14 +131,7 @@ One of the values. Initializes a new instance of the class with the specified . - - - + To be added. @@ -184,14 +166,7 @@ Gets the level of access to network information controlled by this permission. One of the values. - - created with is given | access. A created with is given access. - - ]]> - + To be added. @@ -229,14 +204,7 @@ One of the values. Adds the specified value to this permission. - - - + To be added. @@ -272,14 +240,7 @@ Creates and returns an identical copy of this permission. A that is identical to the current permission. - - - + To be added. @@ -317,14 +278,7 @@ A that contains the XML encoding to use to set the state of the current permission. Sets the state of this permission using the specified XML encoding. - - - + To be added. is . @@ -375,14 +329,7 @@ An to intersect with the current permission. It must be of the same type as the current permission. Creates and returns a permission that is the intersection of the current permission and the specified permission. A that represents the intersection of the current permission and the specified permission. This new permission is if the intersection is empty or is . - - - + To be added. is not a . @@ -424,14 +371,7 @@ Determines whether the current permission is a subset of the specified permission. if the current permission is a subset of the specified permission; otherwise, . - - - + To be added. @@ -471,14 +411,7 @@ Returns a value indicating whether the current permission is unrestricted. if the current permission is unrestricted; otherwise, . - - constructor. - - ]]> - + To be added. @@ -514,14 +447,7 @@ Creates an XML encoding of the state of this permission. A that contains the XML encoding of the current permission. - - - + To be added. @@ -560,14 +486,7 @@ A permission to combine with the current permission. Creates a permission that is the union of this permission and the specified permission. A new permission that represents the union of the current permission and the specified permission. - - method returns a permission that represents all the states represented by both the current permission and the specified permission. Any demand that passes either permission passes their union. - - ]]> - + To be added. diff --git a/xml/System.Net.NetworkInformation/NetworkInformationPermissionAttribute.xml b/xml/System.Net.NetworkInformation/NetworkInformationPermissionAttribute.xml index 5e95200a1c0..dcd63d70e0b 100644 --- a/xml/System.Net.NetworkInformation/NetworkInformationPermissionAttribute.xml +++ b/xml/System.Net.NetworkInformation/NetworkInformationPermissionAttribute.xml @@ -44,16 +44,12 @@ Allows security actions for to be applied to code using declarative security. - namespace. - - The security information declared by a security attribute is stored in the metadata of the attribute target and is accessed by the system at run time. Security attributes are used only for declarative security. For imperative security, use the class. - ]]> @@ -90,14 +86,7 @@ A value that specifies the permission behavior. Initializes a new instance of the class. - - - + To be added. @@ -132,20 +121,7 @@ Gets or sets the network information access level. A string that specifies the access level. - - - + To be added. @@ -181,14 +157,7 @@ Creates and returns a new object. A that corresponds to this attribute. - - - + To be added. diff --git a/xml/System.Net.NetworkInformation/PhysicalAddress.xml b/xml/System.Net.NetworkInformation/PhysicalAddress.xml index a4b74b5eaf9..151e0a86851 100644 --- a/xml/System.Net.NetworkInformation/PhysicalAddress.xml +++ b/xml/System.Net.NetworkInformation/PhysicalAddress.xml @@ -467,27 +467,17 @@ method to retrieve the address from an existing instance. - - ## Examples The following code example creates a instance by calling the method. diff --git a/xml/System.Net.NetworkInformation/Ping.xml b/xml/System.Net.NetworkInformation/Ping.xml index b59a82cfc80..95d69921909 100644 --- a/xml/System.Net.NetworkInformation/Ping.xml +++ b/xml/System.Net.NetworkInformation/Ping.xml @@ -114,10 +114,6 @@ ]]> - How to: Ping a Host - Network Programming in the .NET Framework - Network Programming Samples - NetworkInformation diff --git a/xml/System.Net.PeerToPeer.Collaboration/PeerCollaborationPermission.xml b/xml/System.Net.PeerToPeer.Collaboration/PeerCollaborationPermission.xml index d9360bdd72f..a2a4a22b748 100644 --- a/xml/System.Net.PeerToPeer.Collaboration/PeerCollaborationPermission.xml +++ b/xml/System.Net.PeerToPeer.Collaboration/PeerCollaborationPermission.xml @@ -49,10 +49,6 @@ [!INCLUDE[cas-deprecated](~/includes/cas-deprecated.md)] - The default allow all local and Intranet zone applications to access collaboration services, and no permission is granted for Internet zone applications. In other words, if the default permissions are not changed, all link-local and site-local applications have access to Peer-To-Peer collaboration services, but global applications have no access. - - This class is not derivable. - ]]> @@ -91,16 +87,7 @@ One of the values in the enumeration. Initializes a new instance of the . The initial for this instance is passed when the constructor is called. - - , the instance passes all demands. If state contains any other value, the instance fails all demands. - - ]]> - + To be added. @@ -137,14 +124,7 @@ Creates and returns a copy of the current . A that contains a copy of the current instance of . - - instance grants the same access to resources as the original permission. - - ]]> - + To be added. @@ -182,16 +162,7 @@ The XML encoding to use to reconstruct the permission. Represents the XML object model for encoding security objects. - - - + To be added. The parameter is not a valid permission element. -or- @@ -241,22 +212,7 @@ The parameter's version number is not supported. Permission to with the current permission. It must be of the same type as the current permission. Creates and returns a permission that is the intersection of the current and the specified permission. A new permission that represents the intersection of the current and the specified permission. This new permission is a reference ( in Visual Basic) if the intersection is empty. - - method. X and Y represent object references that are not a `null` reference (`Nothing` in Visual Basic). - -- X.Intersect(X) returns a value equal to X. - -- X.Intersect(Y) returns the same value as Y.Intersect(X). - -- X.Intersect(a `null` reference) returns a `null` reference. - - ]]> - + To be added. The target parameter is not a reference ( in Visual Basic) and is not an instance of the same class as the current permission. @@ -299,24 +255,7 @@ The parameter's version number is not supported. Determines whether the current is a subset of the specified permission. if the current is a subset of the specified permission; otherwise, . - - is a subset of the specified permission if the current permission specifies a set of operations that is wholly contained by the specified permission. For example, a permission that represents access to "*C:\example.txt*" is a subset of a permission that represents access to "*C:\\*". If this method returns `true`, the current permission represents no more access to the protected resource than does the specified permission. - - The following statements are required to be `true` for all implementations of the method. X, Y, and Z represent objects that are not a `null` reference (`Nothing` in Visual Basic). - -- X.IsSubsetOf(X) returns `true`. - -- X.IsSubsetOf(Y) returns the same value as Y.IsSubsetOf(X) if and only if X and Y represent the same set of permissions. - -- If X.IsSubsetOf(Y) and Y.IsSubsetOf(Z) both return `true`, X.IsSubsetOf(Z) returns `true`. - - If X represents an empty object with a permission state of `None`, and Y represents an `IPermission` object that is a `null` reference (`Nothing` in Visual Basic), X.IsSubsetOf(Y) returns `true`. If Z is also an empty permission, the compound set operation X.Union(Z).IsSubsetOf(Y) also returns `true` because the of two empty permissions is an empty permission. - - ]]> - + To be added. The parameter is a reference ( in Visual Basic). @@ -359,14 +298,7 @@ The parameter's version number is not supported. Returns a value specifying whether the current is unrestricted. if the current permission is unrestricted; otherwise, . - - - + To be added. @@ -404,14 +336,7 @@ The parameter's version number is not supported. Creates an XML encoding of the and its current state. An XML encoding of the permission, including any state information. - - - + To be added. @@ -451,22 +376,7 @@ The parameter's version number is not supported. A permission to combine with the current permission. It must be of the same type as the current permission. Creates a permission that is the union of the current and the specified permission. A new permission that represents the of the current and the specified permission. - - is a permission that represents all the operations represented by both the current and the specified permission. Any demand that passes either permission passes their union. - - The following statements are required to be `true` for all implementations of the Union method. X and Y represent objects that are not a `null` reference (`Nothing` in Visual Basic). - -- X.Union(X) returns an object that has the same value as X. - -- X.Union(Y) returns an object that has the same value as the object returned by Y.Union(X). - -- X.Union(a `null` reference (`Nothing` in Visual Basic)) returns an object that has the same value as X. - - ]]> - + To be added. The parameter is a reference ( in Visual Basic). diff --git a/xml/System.Net.PeerToPeer.Collaboration/PeerCollaborationPermissionAttribute.xml b/xml/System.Net.PeerToPeer.Collaboration/PeerCollaborationPermissionAttribute.xml index 80843c310fe..906b1141c46 100644 --- a/xml/System.Net.PeerToPeer.Collaboration/PeerCollaborationPermissionAttribute.xml +++ b/xml/System.Net.PeerToPeer.Collaboration/PeerCollaborationPermissionAttribute.xml @@ -43,16 +43,12 @@ Allows security actions for to be applied to code using declarative security. This class cannot be inherited. - that is used. - - The security information declared by a security attribute is stored in the metadata of the attribute target and is accessed by the system at run time. Security attributes are used only for declarative security. For imperative security, use the corresponding permission class. - ]]> @@ -90,14 +86,7 @@ Specifies a value. Initializes a new instance of the class with the specified . - - works with to allow or deny a peer access to the collaboration session. - - ]]> - + To be added. @@ -133,14 +122,7 @@ Creates and returns a new . A new object. - - . - - ]]> - + To be added. When permissions are inherited , must be overridden. diff --git a/xml/System.Net.PeerToPeer/PnrpPermission.xml b/xml/System.Net.PeerToPeer/PnrpPermission.xml index 1eff1490e65..542ad4d6fee 100644 --- a/xml/System.Net.PeerToPeer/PnrpPermission.xml +++ b/xml/System.Net.PeerToPeer/PnrpPermission.xml @@ -49,17 +49,8 @@ [!INCLUDE[cas-deprecated](~/includes/cas-deprecated.md)] - The default permissions allow all local and Intranet zone applications to access PNRP services. If the default permissions are not changed, all link-local and site-local applications have access to Peer-to-Peer services, but global (internet) applications have no access. - - Instances of this type have two permission states: they either have no access to the resources protected by the permission, or they have unrestricted full access to those resources. - ]]> - - - - - PNRP Namespace Provider API @@ -93,20 +84,7 @@ One of the values in the enumeration. Initializes a new instance of the class with the supplied initial permission state. - - - - - - - + To be added. @@ -141,26 +119,13 @@ Creates and returns an identical copy of the current . An object with an IPermission interface, whose instance contains a copy of the current instance of . - - - + To be added. The parameter is not a valid element. -or- The parameter's version number is not supported. The parameter is a reference ( in Visual Basic). - - - - PNRP Namespace Provider API @@ -197,25 +162,13 @@ The parameter's version number is not supported. The XML encoding to use to reconstruct the permission. Reconstructs a security object with a specified state from an XML encoding. - - - + To be added. The parameter is not a valid element. -or- The parameter's version number is not supported. The parameter is a reference ( in Visual Basic). - - - @@ -253,26 +206,8 @@ The parameter's version number is not supported. A permission to with the current permission. It must be of the same type as the current permission. Creates and returns a permission that is the intersection of the current and the specified permission. A new permission that represents the intersection of the current and the specified permission. This new permission is a reference ( in Visual Basic) if the intersection is empty. - - object references that are not a `null` reference (Nothing in Visual Basic). - -- X.Intersect(X) returns a value equal to X. - -- X.Intersect(Y) returns the same value as Y.Intersect(X). - -- X.Intersect(a `null` reference (`Nothing` in Visual Basic)) returns a `null` reference (`Nothing` in Visual Basic). - - ]]> - + To be added. The target parameter is not a reference ( in Visual Basic) and is not an instance of the same class as the current permission. - - - @@ -311,29 +246,8 @@ The parameter's version number is not supported. Determines whether the current is a subset of the specified permission. if the current is a subset of the specified permission; otherwise, . - - is a subset of the specified permission if the current permission specifies a set of operations that is wholly contained by the specified permission. For example, a permission that represents access to "*C:\example.txt*" is a subset of a permission that represents access to "*C:\\*". If this method returns `true`, the current permission represents no more access to the protected resource than does the specified permission. - -The following statements are required to be `true` for all implementations of the IsSubsetOf method. X, Y, and Z represent objects that are not a `null` reference (`Nothing` in Visual Basic). - -- `X.IsSubsetOf(X)` returns `true`. - -- `X.IsSubsetOf(Y)` returns the same value as `Y.IsSubsetOf(X)` if and only if X and Y represent the same set of permissions. - -- If `X.IsSubsetOf(Y)` and `Y.IsSubsetOf(Z)` both return `true`, `X.IsSubsetOf(Z)` returns `true`. - -If X represents an empty object with a permission state of *None*, and Y represents an object that is a `null` reference (`Nothing` in Visual Basic), `X.IsSubsetOf(Y)` returns `true`. If Z is also an empty permission, the compound set operation `X.Union(Z).IsSubsetOf(Y)` also returns `true` because the of two empty permissions is an empty permission. - - ]]> - + To be added. The target parameter is not a reference ( in Visual Basic) and is not an instance of the same class as the current permission. - - - @@ -372,18 +286,7 @@ If X represents an empty object with a permis Returns a value specifying whether the current is unrestricted. if the current permission is unrestricted; otherwise, . - - - - - - - + To be added. @@ -419,8 +322,6 @@ If X represents an empty object with a permis Creates an XML encoding of the and its current state. A object that contains an XML encoding of the permission, including any state information. To be added. - - @@ -458,27 +359,9 @@ If X represents an empty object with a permis A permission to combine with the current permission. It must be of the same type as the current permission. Creates a permission that is the union of the current and the specified permission. A new permission that represents the of the current and the specified permission. - - is a permission that represents all the operations represented by both the current and the specified permission. Any demand that passes either permission passes their union. - - The following statements are required to be `true` for all implementations of the Union method. X and Y represent objects that are not a `null` reference (`Nothing` in Visual Basic). - -- X.Union(X) returns an object that has the same value as X. - -- X.Union(Y) returns an object that has the same value as the object returned by Y.Union(X). - -- X.Union(a `null` reference (`Nothing` in Visual Basic)) returns an object that has the same value as X. - - ]]> - + To be added. parameter is invalid. - - - diff --git a/xml/System.Net.PeerToPeer/PnrpPermissionAttribute.xml b/xml/System.Net.PeerToPeer/PnrpPermissionAttribute.xml index 126caeac640..6cdcd0a4a32 100644 --- a/xml/System.Net.PeerToPeer/PnrpPermissionAttribute.xml +++ b/xml/System.Net.PeerToPeer/PnrpPermissionAttribute.xml @@ -43,16 +43,12 @@ Allows security actions for to be applied to code using declarative security. - that is used. - - The security information declared by a security attribute is stored in the metadata of the attribute target and is accessed by the system at run time. Security attributes are used only for declarative security. For imperative security, use the corresponding permission class. - ]]> @@ -88,14 +84,7 @@ One of the values. Initializes a new instance of the class with the specified . - - works with to allow or deny actions by the peer granted the permission and the permission attribute. - - ]]> - + To be added. @@ -133,11 +122,6 @@ Creates and returns a new . A new object. To be added. - - This method is not used, and is included only to support inheritance from at compile time or during interpretation. - - When this class inherits from , it overrides automatically at compile time or at run-time. - diff --git a/xml/System.Net.Security/SslClientAuthenticationOptions.xml b/xml/System.Net.Security/SslClientAuthenticationOptions.xml index f9fd8b5198e..23464a9152f 100644 --- a/xml/System.Net.Security/SslClientAuthenticationOptions.xml +++ b/xml/System.Net.Security/SslClientAuthenticationOptions.xml @@ -46,9 +46,9 @@ and, in .NET 5 and later versions, for . + This property bag is used as argument for and . - The uses this property bag in the property. +The uses this property bag in the property. ]]> diff --git a/xml/System.Net.Security/SslStream.xml b/xml/System.Net.Security/SslStream.xml index 0680cb37634..60ba5de187a 100644 --- a/xml/System.Net.Security/SslStream.xml +++ b/xml/System.Net.Security/SslStream.xml @@ -87,15 +87,9 @@ assumes that a timeout along with any other when one is thrown from the inner stream will be treated as fatal by its caller. Reusing a instance after a timeout will return garbage. An application should the and throw an exception in these cases. - The .NET Framework 4.6 includes a security feature that blocks insecure cipher and hashing algorithms for connections. Applications using TLS/SSL through APIs such as HttpClient, HttpWebRequest, FTPClient, SmtpClient, and SslStream and targeting .NET Framework 4.6 get the more-secure behavior by default. - - Developers may want to opt out of this behavior in order to maintain interoperability with their existing SSL3 services OR TLS w/ RC4 services. [This article](https://support.microsoft.com/kb/3069494) explains how to modify your code so that the new behavior is disabled. - - The .NET Framework 4.7 adds new overloads for the methods that authenticate SslStreams that do not specify a TLS version, but instead use the TLS version defined as the system default in [SCHANNEL](/windows/win32/secauthn/secure-channel). Use these methods in your app as a way to be able to later modify the defaults as TLS version best practice changes over time, without the need to rebuild and redeploy your app. - - Also see [Transport Layer Security (TLS) best practices with the .NET Framework](/dotnet/framework/network-programming/tls). - +To opt out of the behavior that blocks insecure cipher and hashing algorithms for connections in order to maintain interoperability with your existing SSL3 services OR TLS w/ RC4 services, see [Cannot connect to a server by using the ServicePointManager or SslStream APIs after upgrade to .NET Framework 4.6](https://support.microsoft.com/kb/3069494). +Use the overloads for methods that authenticate SslStreams that don't specify a TLS version, but instead use the TLS version defined as the system default in [SCHANNEL](/windows/win32/secauthn/secure-channel), as a way to be able to later modify the defaults, without the need to rebuild and redeploy your app. ## Examples The following code example demonstrates creating an that uses the class to communicate with clients. @@ -337,12 +331,10 @@ The use of the Null cipher is required when the encryption policy is set to . > [!NOTE] -> .NET caches SSL sessions as they are created and attempts to reuse a cached session for subsequent requests, if possible. When attempting to reuse an SSL session, the Framework uses the first element of the provided during authentication (if there is one), or tries to reuse an anonymous sessions if the certificate collection is empty. +> .NET caches SSL sessions as they are created and attempts to reuse a cached session for subsequent requests, if possible. When attempting to reuse an SSL session, .NET uses the first element of the provided during authentication (if there is one), or tries to reuse an anonymous session if the certificate collection is empty. > [!NOTE] -> Client certificates are not supported in the SSL version 2 protocol. - - +> Client certificates are not supported in the SSL version 2 protocol. ## Examples The following code example creates an and initiates the client portion of the authentication. @@ -436,8 +428,7 @@ The use of the Null cipher is required when the encryption policy is set to . > [!NOTE] -> .NET caches SSL sessions as they are created and attempts to reuse a cached session for subsequent requests, if possible. When attempting to reuse an SSL session, the Framework uses the first element of the provided during authentication (if there is one), or tries to reuse an anonymous sessions if the certificate collection is empty. - +> .NET caches SSL sessions as they are created and attempts to reuse a cached session for subsequent requests, if possible. When attempting to reuse an SSL session, .NET uses the first element of the provided during authentication (if there is one), or tries to reuse an anonymous session if the certificate collection is empty. ## Examples The following code example demonstrates calling this constructor. This example is part of a larger example provided for the class. diff --git a/xml/System.Net.Sockets/IPProtectionLevel.xml b/xml/System.Net.Sockets/IPProtectionLevel.xml index 8ba53f31c65..54cd8866ffe 100644 --- a/xml/System.Net.Sockets/IPProtectionLevel.xml +++ b/xml/System.Net.Sockets/IPProtectionLevel.xml @@ -44,18 +44,17 @@ A value that enables restriction of an IPv6 socket to a specified scope, such as addresses with the same link local or site local prefix. - - <socket> Element (Network Settings) diff --git a/xml/System.Net.Sockets/Socket.xml b/xml/System.Net.Sockets/Socket.xml index 782cc0b2263..bb363683510 100644 --- a/xml/System.Net.Sockets/Socket.xml +++ b/xml/System.Net.Sockets/Socket.xml @@ -82,14 +82,6 @@ implementation, this may lead to unintended data interleaving for large or multi - Network Programming in the .NET Framework - Best Practices for System.Net Classes - Cache Management for Network Applications - Internet Protocol Version 6 - Network Programming Samples - Network Tracing in the .NET Framework - Security in Network Programming - Socket Performance Enhancements in Version 3.5 @@ -127,7 +119,7 @@ implementation, this may lead to unintended data interleaving for large or multi - The socket handle for the socket that the object will encapsulate. + The socket handle for the socket that the object will encapsulate. Initializes a new instance of the class for the specified socket handle. instance with data ga - The socket information returned by . + The socket information returned by . Initializes a new instance of the class using the specified value returned from . instance with data ga > If this constructor throws a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> - The combination of and results in an invalid socket. + The combination of and results in an invalid socket. @@ -309,12 +301,10 @@ This method populates the instance with data ga The `addressFamily` parameter specifies the addressing scheme that the class uses, the `socketType` parameter specifies the type of the class, and the `protocolType` parameter specifies the protocol used by . The three parameters are not independent. Some address families restrict which protocols can be used with them, and often the type is implicit in the protocol. If the combination of address family, type, and protocol type results in an invalid , this constructor throws a . > [!NOTE] -> If this constructor throws a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If this constructor throws a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example demonstrates how to create an instance of the class. @@ -324,7 +314,7 @@ This method populates the instance with data ga ]]> - The combination of , , and results in an invalid socket. + The combination of , , and results in an invalid socket. @@ -383,12 +373,10 @@ This method populates the instance with data ga If you call this method using a non-blocking , and no connection requests are queued, throws a . If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> Before calling the method, you must first call the method to listen for and queue incoming connection requests. +> Before calling the method, you must first call the method to listen for and queue incoming connection requests. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example accepts a simple connection. @@ -399,8 +387,8 @@ This method populates the instance with data ga ]]> An error occurred when attempting to access the socket. - The has been closed. - The accepting socket is not listening for connections. You must call and before calling . + The has been closed. + The accepting socket is not listening for connections. You must call and before calling . @@ -438,7 +426,7 @@ This method populates the instance with data ga You must call the and method before calling the method. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -475,7 +463,7 @@ This method populates the instance with data ga - The socket to use for accepting the connection. + The socket to use for accepting the connection. Accepts an incoming connection. An asynchronous task that completes with the accepted Socket. To be added. @@ -483,7 +471,7 @@ This method populates the instance with data ga You must call the and method before calling the method. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -526,7 +514,7 @@ This method populates the instance with data ga - The object to use for this asynchronous socket operation. + The object to use for this asynchronous socket operation. Begins an asynchronous operation to accept an incoming connection attempt. if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. @@ -542,7 +530,7 @@ This method populates the instance with data ga The following properties and events on the object are required: -- +- The caller can optionally specify an existing to use for the incoming connection by specifying the to use with the property. @@ -568,7 +556,7 @@ This method populates the instance with data ga This exception also occurs if the socket is already connected or a socket operation was already in progress using the specified parameter. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -618,8 +606,8 @@ This method populates the instance with data ga You must call the and method before calling the method. An error occurred when attempting to access the socket. - The has been closed. - The cancellation token was canceled. This exception is stored into the returned task. + The has been closed. + The cancellation token was canceled. This exception is stored into the returned task. @@ -656,7 +644,7 @@ This method populates the instance with data ga - The socket to use for accepting the connection. + The socket to use for accepting the connection. A cancellation token that can be used to cancel the asynchronous operation. Accepts an incoming connection. An asynchronous task that completes with the accepted Socket. @@ -665,8 +653,8 @@ This method populates the instance with data ga You must call the and method before calling the method. An error occurred when attempting to access the socket. - The has been closed. - The cancellation token was canceled. This exception is stored into the returned task. + The has been closed. + The cancellation token was canceled. This exception is stored into the returned task. @@ -767,7 +755,7 @@ This method populates the instance with data ga Gets the amount of data that has been received from the network and is available to be read. - The number of bytes of data received from the network and available to be read. + The number of bytes of data received from the network and available to be read. instance with data ga If the remote host shuts down or closes the connection, can throw a . If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example compares the results of calling IOControl with FIONREAD and the Available property. @@ -789,7 +775,7 @@ This method populates the instance with data ga ]]> An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -853,7 +839,7 @@ This method populates the instance with data ga - The delegate. + The delegate. An object that contains state information for this request. Begins an asynchronous operation to accept an incoming connection attempt. An that references the asynchronous creation. @@ -873,33 +859,30 @@ This method populates the instance with data ga To cancel a pending call to the method, close the . When the method is called while an asynchronous operation is in progress, the callback provided to the method is called. A subsequent call to the method will throw an (before .NET 7) or a (on .NET 7+) to indicate that the operation has been cancelled. > [!NOTE] -> You can use the property of the returned to identify the remote host's network address and port number. +> You can use the property of the returned to identify the remote host's network address and port number. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. ]]> - The object has been closed. - The accepting socket is not listening for connections. You must call and before calling . + The object has been closed. + The accepting socket is not listening for connections. You must call and before calling . -or- The accepted socket is bound. - .NET Framework only: An error occurred when attempting to access the socket. - Asynchronous Client Socket Example - Asynchronous Server Socket Example @@ -950,8 +933,8 @@ This method populates the instance with data ga - The number of bytes to accept from the sender. - The delegate. + The number of bytes to accept from the sender. + The delegate. An object that contains state information for this request. Begins an asynchronous operation to accept an incoming connection attempt and receives the first block of data sent by the client application. An that references the asynchronous creation. @@ -971,35 +954,32 @@ This method populates the instance with data ga To cancel a pending call to the method, close the . When the method is called while an asynchronous operation is in progress, the callback provided to the method is called. A subsequent call to the method will throw an (before .NET 7) or a (on .NET 7+) to indicate that the operation has been cancelled. > [!NOTE] -> You can use the property of the returned to identify the remote host's network address and port number. +> You can use the property of the returned to identify the remote host's network address and port number. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> - The object has been closed. - The accepting socket is not listening for connections. You must call and before calling . + The object has been closed. + The accepting socket is not listening for connections. You must call and before calling . -or- The accepted socket is bound. is less than 0. - .NET Framework only: An error occurred when attempting to access the socket. - Asynchronous Client Socket Example - Asynchronous Server Socket Example @@ -1051,9 +1031,9 @@ This method populates the instance with data ga - The accepted object. This value may be . - The maximum number of bytes to receive. - The delegate. + The accepted object. This value may be . + The maximum number of bytes to receive. + The delegate. An object that contains state information for this request. Begins an asynchronous operation to accept an incoming connection attempt from a specified socket and receives the first block of data sent by the client application. An object that references the asynchronous object creation. @@ -1073,35 +1053,32 @@ This method populates the instance with data ga To cancel a pending call to the method, close the . When the method is called while an asynchronous operation is in progress, the callback provided to the method is called. A subsequent call to the method will throw an (before .NET 7) or a (on .NET 7+) to indicate that the operation has been cancelled. > [!NOTE] -> You can use the property of the returned to identify the remote host's network address and port number. +> You can use the property of the returned to identify the remote host's network address and port number. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> - The object has been closed. - The accepting socket is not listening for connections. You must call and before calling . + The object has been closed. + The accepting socket is not listening for connections. You must call and before calling . -or- The accepted socket is bound. is less than 0. - .NET Framework only: An error occurred when attempting to access the socket. - Asynchronous Client Socket Example - Asynchronous Server Socket Example @@ -1172,7 +1149,7 @@ This method populates the instance with data ga An that represents the remote host. - The delegate. + The delegate. An object that contains state information for this request. Begins an asynchronous request for a remote host connection. An that references the asynchronous connection. @@ -1192,25 +1169,24 @@ This method populates the instance with data ga To cancel a pending call to the method, close the . When the method is called while an asynchronous operation is in progress, the callback provided to the method is called. A subsequent call to the method will throw an (before .NET 7) or a (on .NET 7+) to indicate that the operation has been cancelled. > [!NOTE] -> You can use the property of the returned to identify the remote host's network address and port number. +> You can use the property of the returned to identify the remote host's network address and port number. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> is . - .NET Framework only: An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. - The has been placed in a listening state by calling , or an asynchronous operation is already in progress. + The has been placed in a listening state by calling , or an asynchronous operation is already in progress. @@ -1277,8 +1253,8 @@ This method populates the instance with data ga - The of the remote host. - The port number of the remote host. + The of the remote host. + The port number of the remote host. An delegate that references the method to invoke when the connect operation is complete. A user-defined object that contains information about the connect operation. This object is passed to the delegate when the operation is complete. Begins an asynchronous request for a remote host connection. The host is specified by an and a port number. @@ -1303,27 +1279,26 @@ This method populates the instance with data ga To cancel a pending call to the method, close the . When the method is called while an asynchronous operation is in progress, the callback provided to the method is called. A subsequent call to the method will throw an (before .NET 7) or a (on .NET 7+) to indicate that the operation has been cancelled. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> If this socket has previously been disconnected, then must be called on a thread that will not exit until the operation is complete. This is a limitation of the underlying provider. +> If this socket has previously been disconnected, then must be called on a thread that will not exit until the operation is complete. This is a limitation of the underlying provider. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> is . - .NET Framework only: An error occurred when attempting to access the socket. - The has been closed. - The is not in the socket family. - The port number is not valid. - The length of is zero. - The has been placed in a listening state by calling , or an asynchronous operation is already in progress. + The has been closed. + The is not in the socket family. + The port number is not valid. + The length of is zero. + The has been placed in a listening state by calling , or an asynchronous operation is already in progress. @@ -1391,7 +1366,7 @@ This method populates the instance with data ga At least one , designating the remote host. - The port number of the remote host. + The port number of the remote host. An delegate that references the method to invoke when the connect operation is complete. A user-defined object that contains information about the connect operation. This object is passed to the delegate when the operation is complete. Begins an asynchronous request for a remote host connection. The host is specified by an array and a port number. @@ -1416,27 +1391,26 @@ This method populates the instance with data ga To cancel a pending call to the method, close the . When the method is called while an asynchronous operation is in progress, the callback provided to the method is called. A subsequent call to the method will throw an (before .NET 7) or a (on .NET 7+) to indicate that the operation has been cancelled. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> If this socket has previously been disconnected, then must be called on a thread that will not exit until the operation is complete. This is a limitation of the underlying provider. +> If this socket has previously been disconnected, then must be called on a thread that will not exit until the operation is complete. This is a limitation of the underlying provider. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> is . - .NET Framework only: An error occurred when attempting to access the socket. - The has been closed. + The has been closed. This method is valid for sockets that use or . - The port number is not valid. - The length of is zero. - The has been placed in a listening state by calling , or an asynchronous operation is already in progress. + The port number is not valid. + The length of is zero. + The has been placed in a listening state by calling , or an asynchronous operation is already in progress. @@ -1503,8 +1477,8 @@ This method populates the instance with data ga - The name of the remote host. - The port number of the remote host. + The name of the remote host. + The port number of the remote host. An delegate that references the method to invoke when the connect operation is complete. A user-defined object that contains information about the connect operation. This object is passed to the delegate when the operation is complete. Begins an asynchronous request for a remote host connection. The host is specified by a host name and a port number. @@ -1529,25 +1503,25 @@ This method populates the instance with data ga To cancel a pending call to the method, close the . When the method is called while an asynchronous operation is in progress, the callback provided to the method is called. A subsequent call to the method will throw an (before .NET 7) or a (on .NET 7+) to indicate that the operation has been cancelled. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> If this socket has previously been disconnected, then must be called on a thread that will not exit until the operation is complete. This is a limitation of the underlying provider. +> If this socket has previously been disconnected, then must be called on a thread that will not exit until the operation is complete. This is a limitation of the underlying provider. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> is . - The has been closed. + The has been closed. This method is valid for sockets in the or families. - The port number is not valid. - The has been placed in a listening state by calling , or an asynchronous operation is already in progress. + The port number is not valid. + The has been placed in a listening state by calling , or an asynchronous operation is already in progress. @@ -1607,7 +1581,7 @@ This method populates the instance with data ga if this socket can be reused after the connection is closed; otherwise, . - The delegate. + The delegate. An object that contains state information for this request. Begins an asynchronous request to disconnect from a remote endpoint. An object that references the asynchronous operation. @@ -1625,15 +1599,14 @@ This method populates the instance with data ga The operation must be completed by calling the method. Typically, the method is invoked by the provided delegate. will block the calling thread until the operation is completed. > [!NOTE] -> If you receive a exception, use the property to obtain the specific error code. +> If you receive a exception, use the property to obtain the specific error code. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> - The object has been closed. - .NET Framework only: An error occurred when attempting to access the socket. + The object has been closed. @@ -1722,25 +1695,24 @@ This method populates the instance with data ga Close the to cancel a pending . When the method is called while an asynchronous operation is in progress, the callback provided to the method is called. A subsequent call to the method will throw an (before .NET 7) or a (on .NET 7+) to indicate that the operation has been cancelled. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. +> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. > [!NOTE] -> `state` is an instantiation of a user-defined class. +> `state` is an instantiation of a user-defined class. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> is . - .NET Framework only: An error occurred when attempting to access the socket. has been closed. @@ -1824,25 +1796,24 @@ This method populates the instance with data ga Close the to cancel a pending . When the method is called while an asynchronous operation is in progress, the callback provided to the method is called. A subsequent call to the method will throw an (before .NET 7) or a (on .NET 7+) to indicate that the operation has been cancelled. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. +> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. > [!NOTE] -> `state` is an instantiation of a user-defined class. +> `state` is an instantiation of a user-defined class. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> is . - .NET Framework only: An error occurred when attempting to access the socket. has been closed. @@ -1915,8 +1886,8 @@ This method populates the instance with data ga An array of type that is the storage location for the received data. - The zero-based position in the parameter at which to store the received data. - The number of bytes to receive. + The zero-based position in the parameter at which to store the received data. + The number of bytes to receive. A bitwise combination of the values. An delegate that references the method to invoke when the operation is complete. A user-defined object that contains information about the receive operation. This object is passed to the delegate when the operation is complete. @@ -1936,25 +1907,24 @@ This method populates the instance with data ga Close the to cancel a pending . When the method is called while an asynchronous operation is in progress, the callback provided to the method is called. A subsequent call to the method will throw an (before .NET 7) or a (on .NET 7+) to indicate that the operation has been cancelled. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. +> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. > [!NOTE] -> `state` is an instantiation of a user-defined class. +> `state` is an instantiation of a user-defined class. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> is . - .NET Framework only: An error occurred when attempting to access the socket. has been closed. @@ -2034,8 +2004,8 @@ This method populates the instance with data ga An array of type that is the storage location for the received data. - The location in to store the received data. - The number of bytes to receive. + The location in to store the received data. + The number of bytes to receive. A bitwise combination of the values. A object that stores the socket error. An delegate that references the method to invoke when the operation is complete. @@ -2056,25 +2026,24 @@ This method populates the instance with data ga Close the to cancel a pending . When the method is called while an asynchronous operation is in progress, the callback provided to the method is called. A subsequent call to the method will throw an (before .NET 7) or a (on .NET 7+) to indicate that the operation has been cancelled. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. +> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. > [!NOTE] -> `state` is an instantiation of a user-defined class. +> `state` is an instantiation of a user-defined class. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> is . - .NET Framework only: An error occurred when attempting to access the socket. has been closed. @@ -2162,11 +2131,11 @@ This method populates the instance with data ga An array of type that is the storage location for the received data. - The zero-based position in the parameter at which to store the data. - The number of bytes to receive. + The zero-based position in the parameter at which to store the data. + The number of bytes to receive. A bitwise combination of the values. A reference to an of the same type as the endpoint of the remote host to be updated on synchronous receive. - The delegate. + The delegate. An object that contains state information for this request. Begins to asynchronously receive data from a specified network device. An that references the asynchronous read. @@ -2194,13 +2163,13 @@ This method populates the instance with data ga To cancel a pending , call the method. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -2210,7 +2179,6 @@ This method populates the instance with data ga -or- is . - .NET Framework only: An error occurred when attempting to access the socket. is less than 0. @@ -2225,7 +2193,7 @@ This method populates the instance with data ga -or- is greater than the length of minus the value of the parameter. - The has been closed. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. @@ -2296,11 +2264,11 @@ This method populates the instance with data ga An array of type that is the storage location for the received data. - The zero-based position in the parameter at which to store the data. - The number of bytes to receive. + The zero-based position in the parameter at which to store the data. + The number of bytes to receive. A bitwise combination of the values. A reference to an of the same type as the endpoint of the remote host to be updated on synchronous receive. - The delegate. + The delegate. An object that contains state information for this request. Begins to asynchronously receive the specified number of bytes of data into the specified location of the data buffer, using the specified , and stores the endpoint and packet information. An that references the asynchronous read. @@ -2320,13 +2288,13 @@ This method populates the instance with data ga This method reads data into the `buffer` parameter, and captures the remote host endpoint from which the data is sent, as well as information about the received packet. For information on how to retrieve this endpoint, refer to . This method is most useful if you intend to asynchronously receive connectionless datagrams from an unknown host or multiple hosts. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -2336,7 +2304,6 @@ This method populates the instance with data ga -or- is . - .NET Framework only: An error occurred when attempting to access the socket. is less than 0. @@ -2351,7 +2318,7 @@ This method populates the instance with data ga -or- is greater than the length of minus the value of the parameter. - The has been closed. + The has been closed. @@ -2422,7 +2389,7 @@ This method populates the instance with data ga An array of type that contains the data to send. A bitwise combination of the values. - The delegate. + The delegate. An object that contains state information for this request. Sends data asynchronously to a connected . An that references the asynchronous send. @@ -2442,22 +2409,22 @@ This method populates the instance with data ga If you specify the flag as the `socketflags` parameter, the data you are sending will not be routed. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. +> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. > [!NOTE] -> `state` is an instantiation of a user-defined class. +> `state` is an instantiation of a user-defined class. > [!NOTE] -> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -2465,8 +2432,7 @@ This method populates the instance with data ga is . is empty. - .NET Framework only: An error occurred when attempting to access the socket. See remarks section below. - The has been closed. + The has been closed. @@ -2529,7 +2495,7 @@ This method populates the instance with data ga An array of type that contains the data to send. A bitwise combination of the values. A object that stores the socket error. - The delegate. + The delegate. An object that contains state information for this request. Sends data asynchronously to a connected . An that references the asynchronous send. @@ -2549,22 +2515,22 @@ This method populates the instance with data ga If you specify the flag as the `socketflags` parameter, the data you are sending will not be routed. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. +> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. > [!NOTE] -> `state` is an instantiation of a user-defined class. +> `state` is an instantiation of a user-defined class. > [!NOTE] -> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -2572,8 +2538,7 @@ This method populates the instance with data ga is . is empty. - .NET Framework only: An error occurred when attempting to access the socket. See remarks section below. - The has been closed. + The has been closed. @@ -2643,10 +2608,10 @@ This method populates the instance with data ga An array of type that contains the data to send. - The zero-based position in the parameter at which to begin sending data. - The number of bytes to send. + The zero-based position in the parameter at which to begin sending data. + The number of bytes to send. A bitwise combination of the values. - The delegate. + The delegate. An object that contains state information for this request. Sends data asynchronously to a connected . An that references the asynchronous send. @@ -2666,28 +2631,27 @@ This method populates the instance with data ga If you specify the flag as the `socketflags` parameter, the data you are sending will not be routed. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. +> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. > [!NOTE] -> `state` is an instantiation of a user-defined class. +> `state` is an instantiation of a user-defined class. > [!NOTE] -> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> is . - .NET Framework only: An error occurred when attempting to access the socket. See remarks section below. is less than 0. @@ -2702,7 +2666,7 @@ This method populates the instance with data ga -or- is greater than the length of minus the value of the parameter. - The has been closed. + The has been closed. @@ -2765,11 +2729,11 @@ This method populates the instance with data ga An array of type that contains the data to send. - The zero-based position in the parameter at which to begin sending data. - The number of bytes to send. + The zero-based position in the parameter at which to begin sending data. + The number of bytes to send. A bitwise combination of the values. A object that stores the socket error. - The delegate. + The delegate. An object that contains state information for this request. Sends data asynchronously to a connected . An that references the asynchronous send. @@ -2789,28 +2753,27 @@ This method populates the instance with data ga If you specify the flag as the `socketflags` parameter, the data you are sending will not be routed. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. +> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. > [!NOTE] -> `state` is an instantiation of a user-defined class. +> `state` is an instantiation of a user-defined class. > [!NOTE] -> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> is . - .NET Framework only: An error occurred when attempting to access the socket. See remarks section below. is less than 0. @@ -2825,7 +2788,7 @@ This method populates the instance with data ga -or- is greater than the length of minus the value of the parameter. - The has been closed. + The has been closed. @@ -2894,7 +2857,7 @@ This method populates the instance with data ga A string that contains the path and name of the file to send. This parameter can be . - The delegate. + The delegate. An object that contains state information for this request. Sends the file to a connected object using the flag. An object that represents the asynchronous send. @@ -2914,20 +2877,16 @@ This method populates the instance with data ga Although intended for connection-oriented protocols, also works for connectionless protocols, provided that you first call the or method to establish a default remote host. With connectionless protocols, you must be sure that the size of your file does not exceed the maximum packet size of the underlying service provider. If it does, the datagram is not sent and throws a exception. > [!NOTE] -> If you receive a exception, use the property to obtain the specific error code. +> If you receive a exception, use the property to obtain the specific error code. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - -> [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. ]]> - The object has been closed. - The socket is not connected to a remote host. - The file was not found. - .NET Framework only: An error occurred when attempting to access the socket. See remarks section below. + The object has been closed. + The socket is not connected to a remote host. + The file was not found. @@ -2982,8 +2941,8 @@ This method populates the instance with data ga A string that contains the path and name of the file to be sent. This parameter can be . - The data to be sent before the file is sent. This parameter can be . - The data to be sent after the file is sent. This parameter can be . + The data to be sent before the file is sent. This parameter can be . + The data to be sent after the file is sent. This parameter can be . A bitwise combination of the enumeration values. An delegate to be invoked when this operation completes. This parameter can be . A user-defined object that contains state information for this request. This parameter can be . @@ -3007,24 +2966,23 @@ This method populates the instance with data ga Although intended for connection-oriented protocols, also works for connectionless protocols, provided that you first call the or method to establish a default remote host. With connectionless protocols, you must be sure that the size of your file does not exceed the maximum packet size of the underlying service provider. If it does, the datagram is not sent and throws a exception. > [!NOTE] -> If you receive a exception, use the property to obtain the specific error code. +> If you receive a exception, use the property to obtain the specific error code. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> - The object has been closed. - .NET Framework only: An error occurred when attempting to access the socket. See remarks section below. - The operating system is not Windows NT or later. + The object has been closed. + The operating system is not Windows NT or later. -or- The socket is not connected to a remote host. - The file was not found. + The file was not found. @@ -3089,11 +3047,11 @@ This method populates the instance with data ga An array of type that contains the data to send. - The zero-based position in at which to begin sending data. - The number of bytes to send. + The zero-based position in at which to begin sending data. + The number of bytes to send. A bitwise combination of the values. An that represents the remote device. - The delegate. + The delegate. An object that contains state information for this request. Sends data asynchronously to a specific remote host. An that references the asynchronous send. @@ -3117,13 +3075,13 @@ This method populates the instance with data ga If you specify the flag as the `socketflags` parameter, the data you are sending will not be routed. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. > [!NOTE] -> The execution context (the security context, the impersonated user, and the calling context) is cached for the asynchronous methods. After the first use of a particular context (a specific asynchronous method, a specific instance, and a specific callback), subsequent uses of that context will see a performance improvement. +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -3133,7 +3091,6 @@ This method populates the instance with data ga -or- is . - .NET Framework only: An error occurred when attempting to access the socket. is less than 0. @@ -3148,7 +3105,7 @@ This method populates the instance with data ga -or- is greater than the length of minus the value of the parameter. - The has been closed. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. @@ -3200,7 +3157,7 @@ This method populates the instance with data ga - The local to associate with the . + The local to associate with the . Associates a with a local endpoint. instance with data ga If a UDP socket wants to receive interface information on received packets, the method should be explicitly called with the socket option set to immediately after calling the method. > [!NOTE] -> If you intend to receive multicast datagrams, you must call the method with a multicast port number. +> If you intend to receive multicast datagrams, you must call the method with a multicast port number. > [!NOTE] -> You must call the method if you intend to receive connectionless datagrams using the method. +> You must call the method if you intend to receive connectionless datagrams using the method. > [!NOTE] -> If you receive a when calling the method, use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a when calling the method, use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example binds a using the specified local endpoint. @@ -3239,7 +3194,7 @@ This method populates the instance with data ga is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. @@ -3298,15 +3253,15 @@ This method populates the instance with data ga If you are in blocking mode, and you make a method call that does not complete immediately, your application will block execution until the requested operation completes. If you want execution to continue even though the requested operation is not complete, change the property to `false`. The property has no effect on asynchronous methods. If you are sending and receiving data asynchronously and want to block execution, use the class. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -3348,7 +3303,7 @@ This method populates the instance with data ga - The object used to request the connection to the remote host by calling one of the methods. + The object used to request the connection to the remote host by calling one of the methods. Cancels an asynchronous request for a remote host connection. instance with data ga ]]> - The parameter cannot be null and the cannot be null. + The parameter cannot be null and the cannot be null. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. @@ -3424,12 +3379,10 @@ This method populates the instance with data ga If you need to call without first calling , you can ensure that data queued for outgoing transmission will be sent by setting the option to `false` and specifying a non-zero time-out interval. will then block until this data is sent or until the specified time-out expires. If you set to `false` and specify a zero time-out interval, releases the connection and automatically discards outgoing queued data. > [!NOTE] -> To set the socket option to `false`, create a , set the enabled property to `true`, and set the property to the desired time out period. Use this along with the socket option to call the method. +> To set the socket option to `false`, create a , set the enabled property to `true`, and set the property to the desired time out period. Use this along with the socket option to call the method. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example closes a . @@ -3495,12 +3448,10 @@ This method populates the instance with data ga If you need to call without first calling , you can ensure that data queued for outgoing transmission will be sent by setting the option to `false` and specifying a non-zero time-out interval. will then block until this data is sent or until the specified time-out expires. If you set to `false` and specify a zero time-out interval, releases the connection and automatically discards outgoing queued data. > [!NOTE] -> To set the socket option to `false`, create a , set the enabled property to `true`, and set the property to the desired time-out period. Use this along with the socket option to call the method. +> To set the socket option to `false`, create a , set the enabled property to `true`, and set the property to the desired time-out period. Use this along with the socket option to call the method. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example demonstrates how to close a . @@ -3578,16 +3529,13 @@ This method populates the instance with data ga The method will block, unless you specifically set the property to `false` prior to calling . If you are using a connection-oriented protocol like TCP and you do disable blocking, will throw a because it needs time to make the connection. Connectionless protocols will not throw an exception because they simply establish a default remote host. You can use to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. If the error returned WSAEWOULDBLOCK, the remote host connection has been initiated by a connection-oriented , but has not yet completed successfully. Use the method to determine when the is finished connecting. > [!NOTE] -> If you are using a connection-oriented protocol and did not call before calling , the underlying service provider will assign the local network address and port number. If you are using a connectionless protocol, the service provider will not assign a local network address and port number until you complete a send or receive operation. If you want to change the default remote host, call again with the desired endpoint. +> If you are using a connection-oriented protocol and did not call before calling , the underlying service provider will assign the local network address and port number. If you are using a connectionless protocol, the service provider will not assign a local network address and port number until you complete a send or receive operation. If you want to change the default remote host, call again with the desired endpoint. > [!NOTE] -> If the socket has been previously disconnected, then you cannot use this method to restore the connection. Use one of the asynchronous methods to reconnect. This is a limitation of the underlying provider. +> If the socket has been previously disconnected, then you cannot use this method to restore the connection. Use one of the asynchronous methods to reconnect. This is a limitation of the underlying provider. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example connects to a remote endpoint and then verifies the connection. @@ -3599,9 +3547,9 @@ This method populates the instance with data ga is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. - The has been placed in a listening state by calling . + The has been placed in a listening state by calling . @@ -3653,8 +3601,8 @@ This method populates the instance with data ga - The IP address of the remote host. - The port number of the remote host. + The IP address of the remote host. + The port number of the remote host. Establishes a connection to a remote host. The host is specified by an IP address and a port number. instance with data ga method will block, unless you specifically set the property to `false` prior to calling . If you are using a connection-oriented protocol like TCP and you do disable blocking, will throw a because it needs time to make the connection. Connectionless protocols will not throw an exception because they simply establish a default remote host. You can use to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. If the error returned WSAEWOULDBLOCK, the remote host connection has been initiated by a connection-oriented , but has not yet completed successfully. Use the method to determine when the is finished connecting. > [!NOTE] -> If you are using a connection-oriented protocol and did not call before calling , the underlying service provider will assign the local network address and port number. If you are using a connectionless protocol, the service provider will not assign a local network address and port number until you complete a send or receive operation. If you want to change the default remote host, call again with the desired endpoint. +> If you are using a connection-oriented protocol and did not call before calling , the underlying service provider will assign the local network address and port number. If you are using a connectionless protocol, the service provider will not assign a local network address and port number until you complete a send or receive operation. If you want to change the default remote host, call again with the desired endpoint. > [!NOTE] -> If the socket has been previously disconnected, then you cannot use this method to restore the connection. Use one of the asynchronous methods to reconnect. This is a limitation of the underlying provider. +> If the socket has been previously disconnected, then you cannot use this method to restore the connection. Use one of the asynchronous methods to reconnect. This is a limitation of the underlying provider. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example connects to a remote endpoint and then verifies the connection. @@ -3684,12 +3632,12 @@ This method populates the instance with data ga is . - The port number is not valid. + The port number is not valid. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. This method is valid for sockets in the or families. - The length of is zero. - The has been placed in a listening state by calling . + The length of is zero. + The has been placed in a listening state by calling . @@ -3733,8 +3681,8 @@ This method populates the instance with data ga - The IP addresses of the remote host. - The port number of the remote host. + The IP addresses of the remote host. + The port number of the remote host. Establishes a connection to a remote host. The host is specified by an array of IP addresses and a port number. instance with data ga method will block, unless you specifically set the property to `false` prior to calling . If you are using a connection-oriented protocol like TCP and you do disable blocking, will throw a because it needs time to make the connection. Connectionless protocols will not throw an exception because they simply establish a default remote host. You can use to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. If the error returned WSAEWOULDBLOCK, the remote host connection has been initiated by a connection-oriented , but has not yet completed successfully. Use the method to determine when the is finished connecting. > [!NOTE] -> If you are using a connection-oriented protocol and did not call before calling , the underlying service provider will assign the local network address and port number. If you are using a connectionless protocol, the service provider will not assign a local network address and port number until you complete a send or receive operation. If you want to change the default remote host, call again with the desired endpoint. +> If you are using a connection-oriented protocol and did not call before calling , the underlying service provider will assign the local network address and port number. If you are using a connectionless protocol, the service provider will not assign a local network address and port number until you complete a send or receive operation. If you want to change the default remote host, call again with the desired endpoint. > [!NOTE] -> If the socket has been previously disconnected, then you cannot use this method to restore the connection. Use one of the asynchronous methods to reconnect. This is a limitation of the underlying provider. +> If the socket has been previously disconnected, then you cannot use this method to restore the connection. Use one of the asynchronous methods to reconnect. This is a limitation of the underlying provider. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example connects to a remote endpoint and then verifies the connection. @@ -3764,12 +3712,12 @@ This method populates the instance with data ga is . - The port number is not valid. + The port number is not valid. An error occurred when attempting to access the socket. - The has been closed. - The socket is not in the or families. - The length of is zero. - The has been placed in a listening state by calling . + The has been closed. + The socket is not in the or families. + The length of is zero. + The has been placed in a listening state by calling . @@ -3813,8 +3761,8 @@ This method populates the instance with data ga - The name of the remote host. - The port number of the remote host. + The name of the remote host. + The port number of the remote host. Establishes a connection to a remote host. The host is specified by a host name and a port number. instance with data ga If IPv6 is enabled and the method is called to connect to a host that resolves to both IPv6 and IPv4 addresses, the connection to the IPv6 address will be attempted first before the IPv4 address. This may have the effect of delaying the time to establish the connection if the host is not listening on the IPv6 address. > [!NOTE] -> If you're using a connection-oriented protocol and did not call before calling , the underlying service provider will assign the local network address and port number. If you are using a connectionless protocol, the service provider will not assign a local network address and port number until you complete a send or receive operation. If you want to change the default remote host, call again with the desired endpoint. +> If you're using a connection-oriented protocol and did not call before calling , the underlying service provider will assign the local network address and port number. If you are using a connectionless protocol, the service provider will not assign a local network address and port number until you complete a send or receive operation. If you want to change the default remote host, call again with the desired endpoint. > [!NOTE] -> If the socket has been previously disconnected, then you cannot use this method to restore the connection. Use one of the asynchronous methods to reconnect. This is a limitation of the underlying provider. +> If the socket has been previously disconnected, then you cannot use this method to restore the connection. Use one of the asynchronous methods to reconnect. This is a limitation of the underlying provider. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example connects to a remote endpoint and then verifies the connection. @@ -3846,11 +3794,11 @@ This method populates the instance with data ga is . - The port number is not valid. + The port number is not valid. An error occurred when attempting to access the socket. - The has been closed. - The socket is not in the or families. - The has been placed in a listening state by calling . + The has been closed. + The socket is not in the or families. + The has been placed in a listening state by calling . @@ -3890,15 +3838,15 @@ This method populates the instance with data ga - The endpoint to connect to. + The endpoint to connect to. Establishes a connection to a remote host. An asynchronous task that completes when the connection is established. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - The parameter cannot be null. - The is listening. + The parameter cannot be null. + The is listening. An error occurred when attempting to access the socket. - The local endpoint and the parameter are not the same address family. - The has been closed. + The local endpoint and the parameter are not the same address family. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. @@ -3942,7 +3890,7 @@ This method populates the instance with data ga - The object to use for this asynchronous socket operation. + The object to use for this asynchronous socket operation. Begins an asynchronous request for a connection to a remote host. if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. @@ -3966,9 +3914,8 @@ This method populates the instance with data ga The following properties and events on the object are required: -- - -- +- +- Optionally, a buffer may be provided that will atomically be sent on the socket after the method succeeds. In this case, the property needs to be set to the buffer containing the data to send and the property needs to be set to the number of bytes of data to send from the buffer. Once a connection is established, this buffer of data is sent. @@ -3979,16 +3926,16 @@ This method populates the instance with data ga The method throws if the address family of the and the are not the same address family. > [!NOTE] -> If you receive a when calling this method, use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a when calling this method, use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. ]]> An argument is not valid. This exception occurs if multiple buffers are specified, the property is not null. - The parameter cannot be null and the cannot be null. - The is listening or a socket operation was already in progress using the object specified in the parameter. + The parameter cannot be null and the cannot be null. + The is listening or a socket operation was already in progress using the object specified in the parameter. An error occurred when attempting to access the socket. - The local endpoint and the are not the same address family. - The has been closed. + The local endpoint and the are not the same address family. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. @@ -4026,18 +3973,18 @@ This method populates the instance with data ga - The endpoint to connect to. + The endpoint to connect to. A cancellation token that can be used to cancel the asynchronous operation. Establishes a connection to a remote host. An asynchronous task that completes when the connection is established. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - The parameter cannot be null. - The is listening. + The parameter cannot be null. + The is listening. An error occurred when attempting to access the socket. - The local endpoint and the parameter are not the same address family. - The has been closed. + The local endpoint and the parameter are not the same address family. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. - The cancellation token was canceled. This exception is stored into the returned task. + The cancellation token was canceled. This exception is stored into the returned task. @@ -4068,22 +4015,22 @@ This method populates the instance with data ga - The IPAddress of the remote host to connect to. - The port on the remote host to connect to. + The IPAddress of the remote host to connect to. + The port on the remote host to connect to. Establishes a connection to a remote host. An asynchronous task that completes when the connection is established. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - The parameter cannot be null. + The parameter cannot be null. is less than . -or- is greater than . - The is listening. - The socket is not in the or families. + The is listening. + The socket is not in the or families. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. @@ -4116,22 +4063,22 @@ This method populates the instance with data ga A list of IPAddresses for the remote host that will be used to attempt to connect to the remote host. - The port on the remote host to connect to. + The port on the remote host to connect to. Establishes a connection to a remote host. An asynchronous task that completes when the connection is established. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - The parameter cannot be null. - The parameter cannot be empty array. + The parameter cannot be null. + The parameter cannot be empty array. is less than . -or- is greater than . - The is listening. - The socket is not in the or families. + The is listening. + The socket is not in the or families. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. @@ -4163,22 +4110,22 @@ This method populates the instance with data ga - The hostname of the remote host to connect to. - The port on the remote host to connect to. + The hostname of the remote host to connect to. + The port on the remote host to connect to. Establishes a connection to a remote host. An asynchronous task that completes when the connection is established. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - The parameter cannot be null. + The parameter cannot be null. is less than . -or- is greater than . - The is listening. - The socket is not in the or families. + The is listening. + The socket is not in the or families. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. @@ -4211,24 +4158,24 @@ This method populates the instance with data ga - The IPAddress of the remote host to connect to. - The port on the remote host to connect to. + The IPAddress of the remote host to connect to. + The port on the remote host to connect to. A cancellation token that can be used to cancel the asynchronous operation. Establishes a connection to a remote host. An asynchronous task that completes when the connection is established. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - The parameter cannot be null. + The parameter cannot be null. is less than . -or- is greater than . - The is listening. + The is listening. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. - The cancellation token was canceled. This exception is stored into the returned task. + The cancellation token was canceled. This exception is stored into the returned task. @@ -4261,25 +4208,25 @@ This method populates the instance with data ga A list of IPAddresses for the remote host that will be used to attempt to connect to the remote host. - The port on the remote host to connect to. + The port on the remote host to connect to. A cancellation token that can be used to cancel the asynchronous operation. Establishes a connection to a remote host. An asynchronous task that completes when the connection is established. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - The parameter cannot be null. - The parameter cannot be empty array. + The parameter cannot be null. + The parameter cannot be empty array. is less than . -or- is greater than . - The is listening. - The socket is not in the or families. + The is listening. + The socket is not in the or families. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. - The cancellation token was canceled. This exception is stored into the returned task. + The cancellation token was canceled. This exception is stored into the returned task. @@ -4325,7 +4272,7 @@ This method populates the instance with data ga One of the values. One of the values. - The object to use for this asynchronous socket operation. + The object to use for this asynchronous socket operation. Begins an asynchronous request for a connection to a remote host. if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. @@ -4349,9 +4296,9 @@ This method populates the instance with data ga The following properties and events on the object are required: -- +- -- +- Optionally, a buffer may be provided that will atomically be sent on the socket after the method succeeds. In this case, the property needs to be set to the buffer containing the data to send and the property needs to be set to the number of bytes of data to send from the buffer. Once a connection is established, this buffer of data is sent. @@ -4362,16 +4309,16 @@ This method populates the instance with data ga The method throws if the address family of the and the are not the same address family. > [!NOTE] -> If you receive a when calling this method, use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a when calling this method, use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. ]]> An argument is not valid. This exception occurs if multiple buffers are specified, the property is not null. - The parameter cannot be null and the cannot be null. - The is listening or a socket operation was already in progress using the object specified in the parameter. + The parameter cannot be null and the cannot be null. + The is listening or a socket operation was already in progress using the object specified in the parameter. An error occurred when attempting to access the socket. - The local endpoint and the are not the same address family. - The has been closed. + The local endpoint and the are not the same address family. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. @@ -4404,25 +4351,25 @@ This method populates the instance with data ga - The hostname of the remote host to connect to. - The port on the remote host to connect to. + The hostname of the remote host to connect to. + The port on the remote host to connect to. A cancellation token that can be used to cancel the asynchronous operation. Establishes a connection to a remote host. An asynchronous task that completes when the connection is established. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - The parameter cannot be null. + The parameter cannot be null. is less than . -or- is greater than . - The is listening. - The socket is not in the or families. + The is listening. + The socket is not in the or families. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller higher in the call stack does not have permission for the requested operation. - The cancellation token was canceled. This exception is stored into the returned task. + The cancellation token was canceled. This exception is stored into the returned task. @@ -4581,12 +4528,10 @@ This method populates the instance with data ga If you need to call without first calling , you can set the option to `false` and specify a nonzero time-out interval to ensure that data queued for outgoing transmission is sent. then blocks until the data is sent or until the specified time-out expires. If you set to `false` and specify a zero time-out interval, releases the connection and automatically discards outgoing queued data. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example creates a socket for synchronous communication and sends some data to a remote host. It then calls , to stop the send and receive activity, and , to close the socket connection. @@ -4595,7 +4540,7 @@ This method populates the instance with data ga ]]> - The object has been closed. + The object has been closed. An error occurred when attempting to access the socket. @@ -4638,7 +4583,7 @@ This method populates the instance with data ga - The object to use for this asynchronous socket operation. + The object to use for this asynchronous socket operation. Begins an asynchronous request to disconnect from a remote endpoint. if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. @@ -4652,9 +4597,9 @@ This method populates the instance with data ga ]]> - The parameter cannot be null. + The parameter cannot be null. A socket operation was already in progress using the object specified in the parameter. - The has been closed. + The has been closed. An error occurred when attempting to access the socket. @@ -4693,9 +4638,9 @@ This method populates the instance with data ga Disconnects a connected socket from the remote host. An asynchronous task that completes when the socket is disconnected. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - The object has been closed. + The object has been closed. An error occurred when attempting to access the socket. - The cancellation token was canceled. This exception is stored into the returned task. + The cancellation token was canceled. This exception is stored into the returned task. @@ -4758,7 +4703,7 @@ This method populates the instance with data ga For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> @@ -4817,7 +4762,7 @@ This method populates the instance with data ga When the `disposing` parameter is `true`, this method releases all resources held by any managed objects that this references. This method invokes the `Dispose()` method of each referenced object. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -4884,9 +4829,9 @@ This method populates the instance with data ga ]]> - The socket is not in the family. + The socket is not in the family. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -4929,7 +4874,7 @@ This method populates the instance with data ga if the is a dual-mode socket; otherwise, . The default is if the socket was created by calling the constructor and the operating system supports IPv6; otherwise, the default is . To be added. - The socket is not in the address family. + The socket is not in the address family. @@ -4977,9 +4922,9 @@ This method populates the instance with data ga - The ID of the target process where a duplicate of the socket reference is created. + The ID of the target process where a duplicate of the socket reference is created. Duplicates the socket reference for the target process, and closes the socket for this process. - The socket reference to be passed to the target process. + The socket reference to be passed to the target process. constructor multiple times using the same byte array in the argument in each call. If you do, you'll have multiple managed instances with the same underlying socket, which is strongly discouraged. -On .NET Framework, if the process creating the socket uses asynchronous methods, the process must first set the property to `true`. Otherwise, the asynchronous method will bind the socket to an [I/O completion port](/windows/win32/fileio/i-o-completion-ports) of the creating process, which may cause an to be thrown in the target process. - has limited support on Windows. Unlike on .NET Framework, the property is a NOP, therefore the process creating the socket must never call asynchronous methods on the socket. A call to an asynchronous operation will always bind it to an [I/O completion port](/windows/win32/fileio/i-o-completion-ports) of the creating process, which may cause an to be thrown in the target process. ]]> @@ -5062,7 +5005,7 @@ Duplication of the socket reference failed. ]]> This option is valid for a datagram socket only. - The has been closed. + The has been closed. @@ -5133,7 +5076,7 @@ Duplication of the socket reference failed. > If you receive a , use the property to obtain the specific error code. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -5146,7 +5089,6 @@ Duplication of the socket reference failed. -or- .NET 7+ only: The has been closed. - .NET Framework, .NET Core, and .NET 5-6 only: The has been closed. method was previously called. @@ -5215,11 +5157,10 @@ Duplication of the socket reference failed. > If you receive a , use the property to obtain the specific error code. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> - .NET Framework, .NET Core, and .NET 5-6 only: The has been closed. is empty. @@ -5275,7 +5216,7 @@ Duplication of the socket reference failed. An array of type that contains the bytes transferred. - The number of bytes transferred. + The number of bytes transferred. An object that stores state information for this asynchronous operation as well as any user defined data. Asynchronously accepts an incoming connection attempt and creates a new object to handle remote host communication. This method returns a buffer that contains the initial data and the number of bytes transferred. A object to handle communication with the remote host. @@ -5294,11 +5235,10 @@ Duplication of the socket reference failed. > If you receive a , use the property to obtain the specific error code. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> - .NET Framework, .NET Core, and .NET 5-6 only: The has been closed. is empty. @@ -5367,7 +5307,7 @@ Duplication of the socket reference failed. > If you receive a , use the property to obtain the specific error code. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -5382,7 +5322,6 @@ Duplication of the socket reference failed. -or- .NET 7+ only: The has been closed. - .NET Framework, .NET Core, and .NET 5-6 only: The has been closed. @@ -5439,14 +5378,13 @@ Duplication of the socket reference failed. completes the operation started by . You need to pass the created by the matching call. will block the calling thread until the operation is completed. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> - .NET Framework, .NET Core, and .NET 5-6 only: The has been closed. is . @@ -5458,7 +5396,7 @@ Duplication of the socket reference failed. -or- .NET 7+ only: The has been closed. - The disconnect request has timed out. + The disconnect request has timed out. @@ -5513,7 +5451,7 @@ Duplication of the socket reference failed. An that stores state information and any user defined data for this asynchronous operation. Ends a pending asynchronous read. - The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. If zero bytes are requested, receive operations may complete immediately or may not complete until at least one byte is available (but without consuming any data). + The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. If zero bytes are requested, receive operations may complete immediately or may not complete until at least one byte is available (but without consuming any data). The method will block until data is available. If you are using a connectionless protocol, will read the first enqueued datagram available in the incoming network buffer. If you are using a connection-oriented protocol, the method will read as much data as is available up to the number of bytes you specified in the `size` parameter of the method. If the remote host shuts down the connection with the method, and all available data has been received, the method will complete immediately and return zero bytes. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. +> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -5547,7 +5485,6 @@ Duplication of the socket reference failed. -or- .NET 7+ only: The has been closed. - .NET Framework, .NET Core, and .NET 5-6 only: The has been closed. @@ -5598,7 +5535,7 @@ Duplication of the socket reference failed. An that stores state information and any user defined data for this asynchronous operation. A object that stores the socket error. Ends a pending asynchronous read. - The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. If zero bytes are requested, receive operations may complete immediately or may not complete until at least one byte is available (but without consuming any data). + The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. If zero bytes are requested, receive operations may complete immediately or may not complete until at least one byte is available (but without consuming any data). The method will block until data is available. If you are using a connectionless protocol, will read the first enqueued datagram available in the incoming network buffer. If you are using a connection-oriented protocol, the method will read as much data as is available up to the number of bytes you specified in the `size` parameter of the method. If the remote host shuts down the connection with the method, and all available data has been received, the method will complete immediately and return zero bytes. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. +> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -5632,7 +5569,6 @@ Duplication of the socket reference failed. -or- .NET 7+ only: The has been closed. - .NET Framework, .NET Core, and .NET 5-6 only: The has been closed. @@ -5682,9 +5618,9 @@ Duplication of the socket reference failed. An that stores state information and any user defined data for this asynchronous operation. - The source . + The source . Ends a pending asynchronous read from a specific endpoint. - If successful, the number of bytes received. If unsuccessful, returns 0. + If successful, the number of bytes received. If unsuccessful, returns 0. The method will block until data is available. If you are using a connectionless protocol, will read the first enqueued datagram available in the incoming network buffer. If you are using a connection-oriented protocol, the method will read as much data as is available up to the number of bytes you specified in the `size` parameter of the method. If the remote host shuts down the connection with the method, and all available data has been received, the method will complete immediately and return zero bytes. To obtain the received data, call the method of the object, and extract the buffer contained in the resulting state object. To identify the originating host, extract the and cast it to an . Use the method to obtain the IP address and the method to obtain the port number. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -5715,7 +5651,6 @@ Duplication of the socket reference failed. -or- .NET 7+ only: The has been closed. - .NET Framework, .NET Core, and .NET 5-6 only: The has been closed. @@ -5762,10 +5697,10 @@ Duplication of the socket reference failed. An that stores state information and any user defined data for this asynchronous operation. A bitwise combination of the values for the received packet. - The source . - The and interface of the received packet. + The source . + The and interface of the received packet. Ends a pending asynchronous read from a specific endpoint. This method also reveals more information about the packet than . - If successful, the number of bytes received. If unsuccessful, returns 0. + If successful, the number of bytes received. If unsuccessful, returns 0. Examine `ipPacketInformation` if you need to know if the datagram was sent using a unicast, multicast, or broadcast address. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. ]]> @@ -5797,7 +5732,6 @@ Duplication of the socket reference failed. -or- .NET 7+ only: The has been closed. - .NET Framework, .NET Core, and .NET 5-6 only: The has been closed. @@ -5852,7 +5786,7 @@ Duplication of the socket reference failed. An that stores state information for this asynchronous operation. Ends a pending asynchronous send. - If successful, the number of bytes sent to the ; otherwise, an invalid error. + If successful, the number of bytes sent to the ; otherwise, an invalid error. There is no guarantee that the data you send will appear on the network immediately. To increase network efficiency, the underlying system may delay transmission until a significant amount of outgoing data is collected. A successful completion of the method means that the underlying system has had room to buffer your data for a network send. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. +> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. > [!NOTE] -> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -5891,7 +5825,6 @@ Duplication of the socket reference failed. -or- .NET 7+ only: The has been closed. - .NET Framework, .NET Core, and .NET 5-6 only: The has been closed. @@ -5942,7 +5875,7 @@ Duplication of the socket reference failed. An that stores state information for this asynchronous operation. A object that stores the socket error. Ends a pending asynchronous send. - If successful, the number of bytes sent to the ; otherwise, an invalid error. + If successful, the number of bytes sent to the ; otherwise, an invalid error. There is no guarantee that the data you send will appear on the network immediately. To increase network efficiency, the underlying system may delay transmission until a significant amount of outgoing data is collected. A successful completion of the method means that the underlying system has had room to buffer your data for a network send. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. +> If you receive a , use the property to obtain the specific error code. > [!NOTE] -> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. +> All I/O initiated by a given thread is canceled when that thread exits. A pending asynchronous operation can fail if the thread exits before the operation completes. > [!NOTE] -> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -5981,7 +5914,6 @@ Duplication of the socket reference failed. -or- .NET 7+ only: The has been closed. - .NET Framework, .NET Core, and .NET 5-6 only: The has been closed. @@ -6045,12 +5977,11 @@ Duplication of the socket reference failed. > If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> .NET 8+ only: The socket is not connected to a remote host. - .NET Framework, .NET Core, and .NET 5-6 only: The has been closed. is empty. @@ -6106,7 +6037,7 @@ Duplication of the socket reference failed. An that stores state information and any user defined data for this asynchronous operation. Ends a pending asynchronous send to a specific location. - If successful, the number of bytes sent; otherwise, an invalid error. + If successful, the number of bytes sent; otherwise, an invalid error. If you are using a connectionless protocol, will block until the datagram is sent. If you are using a connection-oriented protocol, will block until the requested number of bytes are sent. There is no guarantee that the data you send will appear on the network immediately. To increase network efficiency, the underlying system may delay transmission until a significant amount of outgoing data is collected. A successful completion of the method means that the underlying system has had room to buffer your data for a network send. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -6137,7 +6068,6 @@ Duplication of the socket reference failed. -or- .NET 7+ only: The has been closed. - .NET Framework, .NET Core, and .NET 5-6 only: The has been closed. @@ -6198,7 +6128,7 @@ Duplication of the socket reference failed. ]]> An error occurred when attempting to access the socket. - The has been closed. + The has been closed. has been called for this . @@ -6283,11 +6213,11 @@ Duplication of the socket reference failed. - The platform-defined option level. - The platform-defined option name. - The span into which the retrieved option value should be stored. + The platform-defined option level. + The platform-defined option name. + The span into which the retrieved option value should be stored. Gets a socket option value using platform-specific level and name identifiers. - The number of bytes written into for a successfully retrieved value. + The number of bytes written into for a successfully retrieved value. - The has been closed. + The has been closed. An error occurred when attempting to access the socket. @@ -6367,12 +6297,10 @@ In general, the `GetSocketOption` method should be used whenever getting a options determine the behavior of the current . Use this overload to get the , , and options. For the option, use for the `optionLevel` parameter. For and , use . If you want to set the value of any of the options listed above, use the method. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example retrieves the and time-out values and displays them to the console. @@ -6387,7 +6315,7 @@ In general, the `GetSocketOption` method should be used whenever getting a was set to the unsupported value . - The has been closed. + The has been closed. @@ -6449,9 +6377,7 @@ In general, the `GetSocketOption` method should be used whenever getting a option, will throw a . If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. Use this overload for any sockets that are represented by Boolean values or integers. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example retrieves the and time-out values and displays them to the console. @@ -6466,7 +6392,7 @@ In general, the `GetSocketOption` method should be used whenever getting a . - The has been closed. + The has been closed. @@ -6517,7 +6443,7 @@ In general, the `GetSocketOption` method should be used whenever getting a One of the values. One of the values. - The length, in bytes, of the expected return value. + The length, in bytes, of the expected return value. Returns the value of the specified option in an array. An array of type that contains the value of the socket option. @@ -6527,12 +6453,10 @@ In general, the `GetSocketOption` method should be used whenever getting a will throw a . Use this overload for any sockets that are represented by Boolean values or integers. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example retrieves the and time-out values and displays them to the console. @@ -6547,7 +6471,7 @@ In general, the `GetSocketOption` method should be used whenever getting a . - The has been closed. + The has been closed. @@ -6653,7 +6577,7 @@ In general, the `GetSocketOption` method should be used whenever getting a A array that contains the input data required by the operation. A array that contains the output data returned by the operation. Sets low-level operating modes for the using numerical control codes. - The number of bytes in the parameter. + The number of bytes in the parameter. method provides low-level access to the operating system underlying the current instance of the class. For more information, see the [WSAIoctl](/windows/win32/api/winsock2/nf-winsock2-wsaioctl) documentation. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example compares the results of FIONREAD and the Available property. @@ -6676,7 +6598,7 @@ In general, the `GetSocketOption` method should be used whenever getting a An error occurred when attempting to access the socket. - The has been closed. + The has been closed. An attempt was made to change the blocking mode without using the property. A caller in the call stack does not have the required permissions. @@ -6728,7 +6650,7 @@ In general, the `GetSocketOption` method should be used whenever getting a An array of type that contains the input data required by the operation. An array of type that contains the output data returned by the operation. Sets low-level operating modes for the using the enumeration to specify control codes. - The number of bytes in the parameter. + The number of bytes in the parameter. underlying the current instance of the class. For more, see the [WSAIoctl](/windows/win32/api/winsock2/nf-winsock2-wsaioctl) documentation. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example compares the results of calling with and the property. @@ -6751,7 +6671,7 @@ In general, the `GetSocketOption` method should be used whenever getting a An error occurred when attempting to access the socket. - The has been closed. + The has been closed. An attempt was made to change the blocking mode without using the property. @@ -6892,7 +6812,7 @@ In general, the `GetSocketOption` method should be used whenever getting a An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -6974,7 +6894,7 @@ The maximum length of the pending connections queue is determined automatically. - The maximum length of the pending connections queue. + The maximum length of the pending connections queue. Places a in a listening state. , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. Use or to accept a connection from the queue. > [!NOTE] -> You must call the method before calling , or will throw a . +> You must call the method before calling , or will throw a . > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. > [!NOTE] -> The backlog parameter is limited to different values depending on the Operating System. You may specify a higher value, but the backlog will be limited based on the Operating System. - - +> The backlog parameter is limited to different values depending on the Operating System. You may specify a higher value, but the backlog will be limited based on the Operating System. ## Examples The following code example uses to listen for incoming connections. @@ -7004,7 +6922,7 @@ The maximum length of the pending connections queue is determined automatically. ]]> An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -7056,7 +6974,7 @@ The maximum length of the pending connections queue is determined automatically. Gets the local endpoint. - The that the is using for communications. + The that the is using for communications. property is usually set after you make a call to the method. If you allow the system to assign your socket's local IP address and port number, the property will be set after the first I/O operation. For connection-oriented protocols, the first I/O operation would be a call to the or method. For connectionless protocols, the first I/O operation would be any of the send or receive calls. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example retrieves and displays the local and remote endpoints. @@ -7082,7 +6998,7 @@ The maximum length of the pending connections queue is determined automatically. ]]> An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -7144,8 +7060,8 @@ The maximum length of the pending connections queue is determined automatically. ]]> An error occurred when attempting to access the socket. - The has been closed. - The is not in the or families. + The has been closed. + The is not in the or families. @@ -7208,7 +7124,7 @@ The maximum length of the pending connections queue is determined automatically. ]]> An error occurred when attempting to access the . - The has been closed. + The has been closed. @@ -7385,10 +7301,10 @@ The maximum length of the pending connections queue is determined automatically. - The time to wait for a response, in microseconds. + The time to wait for a response, in microseconds. One of the values. Determines the status of the . - The status of the based on the polling mode value passed in the parameter. + The status of the based on the polling mode value passed in the parameter.
  • For , it returns if has been called and a connection is pending, if data is available for reading, or if the connection has been closed, reset, or terminated.
  • For , it returns if processing a and the connection has succeeded or if data can be sent.
  • For , it returns if processing a that does not block and the connection has failed, or if is not set and out-of-band data is available.
  • Otherwise, it returns .
method checks the state of the . Specify for the `selectMode` parameter to determine if the is readable. Specify to determine if the is writable. Use to detect an error condition. will block execution until the specified time period, measured in `microseconds`, elapses or data becomes available. Set the `microSeconds` parameter to a negative integer if you would like to wait indefinitely for a response. If you want to check the status of multiple sockets, you might prefer to use the method. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This method cannot detect certain kinds of connection problems, such as a broken network cable, or that the remote host was shut down ungracefully. You must attempt to send or receive data to detect these kinds of errors. +> This method cannot detect certain kinds of connection problems, such as a broken network cable, or that the remote host was shut down ungracefully. You must attempt to send or receive data to detect these kinds of errors. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example creates a socket, connects to a server, and uses to check the status of the socket. @@ -7413,9 +7329,9 @@ The maximum length of the pending connections queue is determined automatically. ]]> - The parameter is not one of the values. + The parameter is not one of the values. An error occurred when attempting to access the socket. See remarks below. - The has been closed. + The has been closed.
@@ -7447,16 +7363,16 @@ The maximum length of the pending connections queue is determined automatically. - The time to wait for a response. + The time to wait for a response. One of the values. Determines the status of the . - The status of the based on the polling mode value passed in the parameter. Returns if any of the following conditions occur before the expires, otherwise, . + The status of the based on the polling mode value passed in the parameter. Returns if any of the following conditions occur before the expires, otherwise, .
  • For , it returns if has been called and a connection is pending, if data is available for reading, or if the connection has been closed, reset, or terminated.
  • For , it returns if processing a and the connection has succeeded or if data can be sent.
  • For , it returns if processing a that does not block and the connection has failed, or if is not set and out-of-band data is available.
  • Otherwise, it returns .
To be added. is less than -1 milliseconds or greater than milliseconds. An error occurred when attempting to access the socket. - The has been closed. + The has been closed.
@@ -7570,7 +7486,7 @@ The maximum length of the pending connections queue is determined automatically. An array of type that is the storage location for the received data. Receives data from a bound into a receive buffer. - The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. + The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. , will read the first queued datagram from the destination address you specify in the method. If the datagram you receive is larger than the size of the `buffer` parameter, `buffer` gets filled with the first part of the message, the excess data is lost and a is thrown. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example receives data on a connected . @@ -7606,7 +7520,7 @@ The maximum length of the pending connections queue is determined automatically. is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. @@ -7664,7 +7578,7 @@ The maximum length of the pending connections queue is determined automatically. A list of s of type that contains the received data. Receives data from a bound into the list of receive buffers. - The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. + The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. , will read the first enqueued datagram from the destination address you specify in the method. If the datagram you receive is larger than the size of the `buffers` parameter, `buffers` gets filled with the first part of the message, the excess data is lost and a is thrown. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. - **Note** This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> [!NOTE] +> This member outputs trace information when you enable network tracing in your application. ]]> - The parameter is . + The parameter is . An error occurred while attempting to access the socket. - The has been closed. + The has been closed. @@ -7727,7 +7642,7 @@ The maximum length of the pending connections queue is determined automatically. A span of bytes that is the storage location for the received data. Receives data from a bound into a receive buffer. - The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. + The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. , [!NOTE] > If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. -This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> [!NOTE] +> This member outputs trace information when you enable network tracing in your application. + ]]> An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. @@ -7806,7 +7723,7 @@ This member outputs trace information when you enable network tracing in your ap An array of type that is the storage location for the received data. A bitwise combination of the values. Receives data from a bound into a receive buffer, using the specified . - The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. + The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. , will read the first enqueued datagram from the destination address you specify in the method. If the datagram you receive is larger than the size of the `buffer` parameter, `buffer` gets filled with the first part of the message, the excess data is lost and a is thrown. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example specifies a data buffer, and for receiving data on a connected . @@ -7842,7 +7757,7 @@ This member outputs trace information when you enable network tracing in your ap is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. @@ -7902,7 +7817,7 @@ This member outputs trace information when you enable network tracing in your ap A list of s of type that contains the received data. A bitwise combination of the values. Receives data from a bound into the list of receive buffers, using the specified . - The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. + The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. , will read the first enqueued datagram from the destination address you specify in the method. If the datagram you receive is larger than the size of the `buffers` parameter, `buffers` gets filled with the first part of the message, the excess data is lost and a is thrown. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example demonstrates how to receive data on a connected . @@ -7942,7 +7855,7 @@ This member outputs trace information when you enable network tracing in your ap .Count is zero. An error occurred while attempting to access the socket. - The has been closed. + The has been closed. @@ -7985,7 +7898,7 @@ This member outputs trace information when you enable network tracing in your ap A span of bytes that is the storage location for the received data. A bitwise combination of the enumeration values that specifies send and receive behaviors. Receives data from a bound into a receive buffer, using the specified . - The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. + The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. , [!NOTE] > If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. -This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> [!NOTE] +> This member outputs trace information when you enable network tracing in your application. ]]> An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. @@ -8063,10 +7977,10 @@ This member outputs trace information when you enable network tracing in your ap An array of type that is the storage location for the received data. - The number of bytes to receive. + The number of bytes to receive. A bitwise combination of the values. Receives the specified number of bytes of data from a bound into a receive buffer, using the specified . - The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. + The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. , will read the first queued datagram from the destination address you specify in the method. If the datagram you receive is larger than the size of the `buffer` parameter, `buffer` gets filled with the first part of the message, the excess data is lost and a is thrown. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following receives the data found into `buffer`, and specifies for . @@ -8104,7 +8016,7 @@ This member outputs trace information when you enable network tracing in your ap exceeds the size of . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. @@ -8166,7 +8078,7 @@ This member outputs trace information when you enable network tracing in your ap A bitwise combination of the values. A object that stores the socket error. Receives data from a bound into the list of receive buffers, using the specified . - The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. + The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. , will read the first queued datagram from the destination address you specify in the method. If the datagram you receive is larger than the size of the `buffers` parameter, `buffers` gets filled with the first part of the message, the excess data is lost and a is thrown. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -8199,7 +8111,7 @@ This member outputs trace information when you enable network tracing in your ap .Count is zero. An error occurred while attempting to access the socket. - The has been closed. + The has been closed. @@ -8244,7 +8156,7 @@ This member outputs trace information when you enable network tracing in your ap A bitwise combination of the enumeration values that specifies send and receive behaviors. When this method returns, contains one of the enumeration values that defines error codes for the socket. Receives data from a bound into a receive buffer, using the specified . - The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. + The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. , the , will read the first queued datagram from the destination address you specify in the method. If the datagram you receive is larger than the size of the `buffer` parameter, `buffer` gets filled with the first part of the message, the excess data is lost and a is thrown. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. @@ -8324,11 +8236,11 @@ If you're using a connectionless , An array of type that is the storage location for received data. - The location in to store the received data. - The number of bytes to receive. + The location in to store the received data. + The number of bytes to receive. A bitwise combination of the values. Receives the specified number of bytes from a bound into the specified offset position of the receive buffer, using the specified . - The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. + The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. , , will read the first queued datagram from the destination address you specify in the method. If the datagram you receive is larger than the size of the `buffer` parameter, `buffer` gets filled with the first part of the message, the excess data is lost and a is thrown. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example specifies a data buffer, an offset, a size, and a socket flag before receiving data on a connected . @@ -8385,7 +8295,7 @@ If you're using a connectionless , . - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. @@ -8439,12 +8349,12 @@ If you're using a connectionless , An array of type that is the storage location for the received data. - The position in the parameter to store the received data. - The number of bytes to receive. + The position in the parameter to store the received data. + The number of bytes to receive. A bitwise combination of the values. A object that stores the socket error. Receives data from a bound into a receive buffer, using the specified . - The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. + The total number of bytes received. The method returns zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. , , will read the first queued datagram from the destination address you specify in the method. If the datagram you receive is larger than the size of the `buffer` parameter, `buffer` gets filled with the first part of the message, the excess data is lost and a is thrown. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -8480,7 +8390,7 @@ If you're using a connectionless , is greater than the length of minus the value of the parameter. - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. @@ -8521,11 +8431,11 @@ If you're using a connectionless , - The buffer for the received data. + The buffer for the received data. Receives data from a connected socket. A task that represents the asynchronous receive operation. The value of its property contains the total number of bytes read into between zero (0) and the number of bytes requested. The result value is zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. If zero bytes are requested, receive operations may complete immediately or may not complete until at least one byte is available (but without consuming any data). To be added. - The has been closed. + The has been closed. An error occurred when attempting to access the socket. @@ -8566,8 +8476,8 @@ If you're using a connectionless , Receives data from a connected socket. A task that represents the asynchronous receive operation. The value of its property contains the total number of bytes read into the buffers between zero (0) and the number of bytes requested. The result value is zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. If zero bytes are requested, receive operations may complete immediately or may not complete until at least one byte is available (but without consuming any data). This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - The parameter was null. - The has been closed. + The parameter was null. + The has been closed. An error occurred when attempting to access the socket.
@@ -8611,7 +8521,7 @@ If you're using a connectionless , - The object to use for this asynchronous socket operation. + The object to use for this asynchronous socket operation. Begins an asynchronous request to receive data from a connected object. if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. @@ -8629,13 +8539,13 @@ If you're using a connectionless , object are required to successfully call this method: -- or +- or -- if is set +- if is set -- if is set +- if is set -- +- The caller may set the property to any user state object desired before calling the method, so that the information will be retrievable in the callback method. If the callback needs more information than a single object, a small class can be created to hold the other required state information as members. @@ -8649,7 +8559,7 @@ If you're using a connectionless , An argument was invalid. The or properties on the parameter must reference valid buffers. One or the other of these properties may be set, but not both at the same time. A socket operation was already in progress using the object specified in the parameter. - The has been closed. + The has been closed. An error occurred when attempting to access the socket. @@ -8694,13 +8604,13 @@ If you're using a connectionless , - The buffer for the received data. + The buffer for the received data. A bitwise combination of SocketFlags values that will be used when receiving the data. Receives data from a connected socket. A task that represents the asynchronous receive operation. The value of its property contains the total number of bytes read into between zero (0) and the number of bytes requested. The result value is zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. If zero bytes are requested, receive operations may complete immediately or may not complete until at least one byte is available (but without consuming any data). To be added. - The has been closed. + The has been closed. An error occurred when attempting to access the socket. @@ -8745,8 +8655,8 @@ If you're using a connectionless , A task that represents the asynchronous receive operation. The value of its property contains the total number of bytes read into between zero (0) and the number of bytes requested. The result value is zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. If zero bytes are requested, receive operations may complete immediately or may not complete until at least one byte is available (but without consuming any data). This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - The parameter was null. - The has been closed. + The parameter was null. + The has been closed. An error occurred when attempting to access the socket. @@ -8776,14 +8686,14 @@ If you're using a connectionless , - The buffer for the received data. + The buffer for the received data. A cancellation token that can be used to cancel the asynchronous operation. Receives data from a connected socket. A that represents the asynchronous receive operation. The value of its property contains the total number of bytes read into between zero (0) and the number of bytes requested. The result value is zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. If zero bytes are requested, receive operations may complete immediately or may not complete until at least one byte is available (but without consuming any data). To be added. - The has been closed. + The has been closed. An error occurred when attempting to access the socket. - The cancellation token was canceled. This exception is stored into the returned task. + The cancellation token was canceled. This exception is stored into the returned task. @@ -8814,15 +8724,15 @@ If you're using a connectionless , - The buffer for the received data. + The buffer for the received data. A bitwise combination of SocketFlags values that will be used when receiving the data. A cancellation token that can be used to cancel the asynchronous operation. Receives data from a connected socket. A that represents the asynchronous receive operation. The value of its property contains the total number of bytes read into between zero (0) and the number of bytes requested. The result value is zero (0) only if zero bytes were requested or if no more bytes are available because the peer socket performed a graceful shutdown. If zero bytes are requested, receive operations may complete immediately or may not complete until at least one byte is available (but without consuming any data). To be added. - The has been closed. + The has been closed. An error occurred when attempting to access the socket. - The cancellation token was canceled. This exception is stored into the returned task. + The cancellation token was canceled. This exception is stored into the returned task. @@ -8880,8 +8790,8 @@ If you're using a connectionless , An error occurred when attempting to access the socket. - The has been closed. - The value specified for a set operation is less than 0. + The has been closed. + The value specified for a set operation is less than 0.
@@ -8939,7 +8849,7 @@ If you're using a connectionless , An array of type that is the storage location for received data. A reference to an of the same type as the endpoint of the remote host to be updated on successful receive. Receives a datagram into the data buffer and stores the endpoint. - The number of bytes received. + The number of bytes received. , that represents the remote host. The buffer offset defaults to 0. The size defaults to the length of the `buffer` parameter and the `socketFlags` value defaults to . > [!NOTE] -> Before calling , you must explicitly bind the to a local endpoint using the method. If you do not, will throw a . +> Before calling , you must explicitly bind the to a local endpoint using the method. If you do not, will throw a . With connectionless protocols, will read the first enqueued datagram received into the local network buffer. If the datagram you receive is larger than the size of `buffer`, the method will fill `buffer` with as much of the message as is possible, and throw a . If you are using an unreliable protocol, the excess data will be lost. If you are using a reliable protocol, the excess data will be retained by the service provider and you can retrieve it by calling the method with a large enough buffer. @@ -8960,15 +8870,13 @@ If you're using a connectionless , will read as much data as is available up to the size of `buffer`. If the remote host shuts down the connection with the method, and all available data has been received, the method will complete immediately and return zero bytes. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> The of the used in needs to match the of the used in . +> The of the used in needs to match the of the used in . > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example receives a connectionless datagram from a remote host. @@ -8985,7 +8893,7 @@ If you're using a connectionless , is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. @@ -9032,12 +8940,12 @@ If you're using a connectionless , A span of bytes that is the storage location for received data. A reference to an of the same type as the endpoint of the remote host to be updated on successful receive. Receives a datagram into the data buffer and stores the endpoint. - The number of bytes received. + The number of bytes received. To be added. remoteEP is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -9087,7 +8995,7 @@ If you're using a connectionless , A bitwise combination of the values. A reference to an of the same type as the endpoint of the remote host to be updated on successful receive. Receives a datagram into the data buffer, using the specified , and stores the endpoint. - The number of bytes received. + The number of bytes received. , , and an that represents the remote host. The offset defaults to 0 and the size defaults to the length of the buffer parameter. > [!NOTE] -> Before calling , you must explicitly bind the to a local endpoint using the method. If you do not, will throw a . +> Before calling , you must explicitly bind the to a local endpoint using the method. If you do not, will throw a . With connectionless protocols, will read the first enqueued datagram received into the local network buffer. If the datagram you receive is larger than the size of `buffer`, the method will fill `buffer` with as much of the message as is possible, and throw a . If you are using an unreliable protocol, the excess data will be lost. If you are using a reliable protocol, the excess data will be retained by the service provider and you can retrieve it by calling the method with a large enough buffer. @@ -9108,15 +9016,13 @@ If you're using a connectionless , will read as much data as is available up to the size of `buffer`. If the remote host shuts down the connection with the method, and all available data has been Received, the method will complete immediately and return zero bytes. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> The of the used in needs to match the of the used in . +> The of the used in needs to match the of the used in . > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example receives a connectionless datagram from a remote host. are passed to the method. @@ -9133,7 +9039,7 @@ If you're using a connectionless , is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. @@ -9183,12 +9089,12 @@ If you're using a connectionless , A bitwise combination of the values. A reference to an of the same type as the endpoint of the remote host to be updated on successful receive. Receives a datagram into the data buffer, using the specified , and stores the endpoint. - The number of bytes received. + The number of bytes received. To be added. remoteEP is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -9229,12 +9135,12 @@ If you're using a connectionless , A bitwise combination of the values. A instance that gets updated with the value of the remote peer when this method returns. Receives a datagram into the data buffer, using the specified , and stores the endpoint. - The number of bytes received. + The number of bytes received. To be added. is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -9282,11 +9188,11 @@ If you're using a connectionless , An array of type that is the storage location for received data. - The number of bytes to receive. + The number of bytes to receive. A bitwise combination of the values. A reference to an of the same type as the endpoint of the remote host to be updated on successful receive. Receives the specified number of bytes into the data buffer, using the specified , and stores the endpoint. - The number of bytes received. + The number of bytes received. , will read as much data as is available up to the number of bytes specified by the `size` parameter. If the remote host shuts down the connection with the method, and all available data has been received, the method will complete immediately and return zero bytes. > [!NOTE] -> Before calling , you must explicitly bind the to a local endpoint using the method. If you do not, will throw a . If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> Before calling , you must explicitly bind the to a local endpoint using the method. If you do not, will throw a . If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> The of the used in needs to match the of the used in . +> The of the used in needs to match the of the used in . > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example receives a connectionless datagram from a remote host. The buffer size, and are passed to the method. @@ -9344,7 +9248,7 @@ If you're using a connectionless , . - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. @@ -9400,12 +9304,12 @@ If you're using a connectionless , An array of type that is the storage location for received data. - The position in the parameter to store the received data. - The number of bytes to receive. + The position in the parameter to store the received data. + The number of bytes to receive. A bitwise combination of the values. A reference to an of the same type as the endpoint of the remote host to be updated on successful receive. Receives the specified number of bytes of data into the specified location of the data buffer, using the specified , and stores the endpoint. - The number of bytes received. + The number of bytes received. , will read as much data as is available up to the amount of bytes specified by the `size` parameter. If the remote host shuts down the connection with the method, and all available data has been Received, the method will complete immediately and return zero bytes. > [!NOTE] -> Before calling , you must explicitly bind the to a local endpoint using the method. If you do not, will throw a . If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> Before calling , you must explicitly bind the to a local endpoint using the method. If you do not, will throw a . If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> The of the used in needs to match the of the used in . +> The of the used in needs to match the of the used in . > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example receives a connectionless datagram from a remote host. The offset, buffer size, and are passed to the method. @@ -9469,7 +9371,7 @@ If you're using a connectionless , - The has been closed. + The has been closed. @@ -9518,7 +9420,7 @@ If you're using a connectionless , - The object to use for this asynchronous socket operation. + The object to use for this asynchronous socket operation. Begins to asynchronously receive data from a specified network device. if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. @@ -9536,15 +9438,15 @@ If you're using a connectionless , object are required to successfully call this method: -- +- -- +- -- +- -- +- -- +- The caller may set the property to any user state object desired before calling the method, so that the information will be retrievable in the callback method. If the callback needs more information than a single object, a small class can be created to hold the other required state information as members. @@ -9554,9 +9456,9 @@ If you're using a connectionless , - The cannot be null. + The cannot be null. A socket operation was already in progress using the object specified in the parameter. - The has been closed. + The has been closed. An error occurred when attempting to access the socket. @@ -9601,7 +9503,7 @@ If you're using a connectionless , - The buffer for the received data. + The buffer for the received data. An endpoint of the same type as the endpoint of the remote host. Receives data and returns the endpoint of the sending host. An asynchronous task that completes with a containing the number of bytes received and the endpoint of the sending host. @@ -9609,7 +9511,7 @@ If you're using a connectionless , is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. @@ -9649,7 +9551,7 @@ If you're using a connectionless , - The buffer for the received data. + The buffer for the received data. A bitwise combination of SocketFlags values that will be used when receiving the data. An endpoint of the same type as the endpoint of the remote host. Receives data and returns the endpoint of the sending host. @@ -9658,7 +9560,7 @@ If you're using a connectionless , is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. @@ -9696,7 +9598,7 @@ If you're using a connectionless , - The buffer for the received data. + The buffer for the received data. An endpoint of the same type as the endpoint of the remote host. A cancellation token that can be used to signal the asynchronous operation should be canceled. Receives data and returns the endpoint of the sending host. @@ -9705,9 +9607,9 @@ If you're using a connectionless , is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. - The cancellation token was canceled. This exception is stored into the returned task. + The cancellation token was canceled. This exception is stored into the returned task. @@ -9746,7 +9648,7 @@ If you're using a connectionless , - The buffer for the received data. + The buffer for the received data. A bitwise combination of SocketFlags values that will be used when receiving the data. An endpoint of the same type as the endpoint of the remote host. A cancellation token that can be used to signal the asynchronous operation should be canceled. @@ -9756,9 +9658,9 @@ If you're using a connectionless , is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. - The cancellation token was canceled. This exception is stored into the returned task. + The cancellation token was canceled. This exception is stored into the returned task. @@ -9795,7 +9697,7 @@ If you're using a connectionless , - The buffer for the received data. + The buffer for the received data. A bitwise combination of the values that will be used when receiving the data. A instance that gets updated with the value of the remote peer when this method returns. A cancellation token that can be used to signal the asynchronous operation should be canceled. @@ -9805,8 +9707,8 @@ If you're using a connectionless , is . An error occurred when attempting to access the socket. - The has been closed. - The cancellation token was canceled. This exception is stored into the returned task. + The has been closed. + The cancellation token was canceled. This exception is stored into the returned task. @@ -9851,12 +9753,12 @@ If you're using a connectionless , A reference to an of the same type as the endpoint of the remote host to be updated on successful receive. An holding address and interface information. Receives the specified number of bytes of data into the specified location of the data buffer, using the specified , and stores the endpoint and packet information. - The number of bytes received. + The number of bytes received. To be added. - The object has been closed. - The remoteEP is . - The of the used in needs to match the of the used in SendTo. - The object is not in blocking mode and cannot accept this synchronous call. + The object has been closed. + The remoteEP is . + The of the used in needs to match the of the used in SendTo. + The object is not in blocking mode and cannot accept this synchronous call. You must call the Bind method before performing this operation. @@ -9906,13 +9808,13 @@ You must call the Bind method before performing this operation. An array of type that is the storage location for received data. - The position in the parameter to store the received data. - The number of bytes to receive. + The position in the parameter to store the received data. + The number of bytes to receive. A bitwise combination of the values. A reference to an of the same type as the endpoint of the remote host to be updated on successful receive. An holding address and interface information. Receives the specified number of bytes of data into the specified location of the data buffer, using the specified , and stores the endpoint and packet information. - The number of bytes received. + The number of bytes received. An application can examine the `ipPacketInformation` parameter if it needs to know if the datagram was sent using a unicast, multicast, or broadcast address. > [!NOTE] -> The of the used in needs to match the of the used in . +> The of the used in needs to match the of the used in . > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -9966,12 +9868,12 @@ You must call the Bind method before performing this operation. -or- - The .NET Framework is running on an AMD 64-bit processor. + .NET is running on an AMD 64-bit processor. -or- An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -10019,7 +9921,7 @@ You must call the Bind method before performing this operation. - The object to use for this asynchronous socket operation. + The object to use for this asynchronous socket operation. Begins to asynchronously receive the specified number of bytes of data into the specified location in the data buffer, using the specified , and stores the endpoint and packet information. if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. @@ -10035,15 +9937,15 @@ You must call the Bind method before performing this operation. The following properties and events on the object are required to successfully call this method: -- +- -- +- -- +- -- +- -- +- The caller may set the property to any user state object desired before calling the method, so that the information will be retrievable in the callback method. If the callback needs more information than a single object, a small class can be created to hold the other required state information as members. @@ -10057,8 +9959,8 @@ You must call the Bind method before performing this operation. ]]> - The cannot be null. - The has been closed. + The cannot be null. + The has been closed. An error occurred when attempting to access the socket. @@ -10103,12 +10005,12 @@ You must call the Bind method before performing this operation. - The buffer for the received data. + The buffer for the received data. An endpoint of the same type as the endpoint of the remote host. Receives data and returns additional information about the sender of the message. An asynchronous task that completes with a containing the number of bytes received and additional information about the sending host. To be added. - The object has been closed. + The object has been closed. is . You must call the Bind method before performing this operation. @@ -10150,13 +10052,13 @@ You must call the Bind method before performing this operation. - The buffer for the received data. + The buffer for the received data. A bitwise combination of SocketFlags values that will be used when receiving the data. An endpoint of the same type as the endpoint of the remote host. Receives data and returns additional information about the sender of the message. An asynchronous task that completes with a containing the number of bytes received and additional information about the sending host. To be added. - The object has been closed. + The object has been closed. is . You must call the Bind method before performing this operation. @@ -10196,17 +10098,17 @@ You must call the Bind method before performing this operation. - The buffer for the received data. + The buffer for the received data. An endpoint of the same type as the endpoint of the remote host. A cancellation token that can be used to signal the asynchronous operation should be canceled. Receives data and returns additional information about the sender of the message. An asynchronous task that completes with a containing the number of bytes received and additional information about the sending host. To be added. - The object has been closed. + The object has been closed. is . You must call the Bind method before performing this operation. - The cancellation token was canceled. This exception is stored into the returned task. + The cancellation token was canceled. This exception is stored into the returned task. @@ -10245,18 +10147,18 @@ You must call the Bind method before performing this operation. - The buffer for the received data. + The buffer for the received data. A bitwise combination of SocketFlags values that will be used when receiving the data. An endpoint of the same type as the endpoint of the remote host. A cancellation token that can be used to signal the asynchronous operation should be canceled. Receives data and returns additional information about the sender of the message. An asynchronous task that completes with a containing the number of bytes received and additional information about the sending host. To be added. - The object has been closed. + The object has been closed. is . You must call the Bind method before performing this operation. - The cancellation token was canceled. This exception is stored into the returned task. + The cancellation token was canceled. This exception is stored into the returned task. @@ -10297,14 +10199,15 @@ You must call the Bind method before performing this operation. Gets or sets a value that specifies the amount of time after which a synchronous call will time out. - The time-out value, in milliseconds. The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period. + The time-out value, in milliseconds. The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period. calls only. If the time-out period is exceeded, the method will throw a . - +> [!NOTE] +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example demonstrates the use of the property. @@ -10314,8 +10217,8 @@ You must call the Bind method before performing this operation. ]]> An error occurred when attempting to access the socket. - The has been closed. - The value specified for a set operation is less than -1. + The has been closed. + The value specified for a set operation is less than -1. @@ -10364,7 +10267,7 @@ You must call the Bind method before performing this operation. Gets the remote endpoint. - The with which the is communicating. + The with which the is communicating. The is set after a call to either or . If you try to access this property earlier, will throw a . If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. -> [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - ## Examples @@ -10387,7 +10287,7 @@ You must call the Bind method before performing this operation. ]]> An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -10480,7 +10380,7 @@ You must call the Bind method before performing this operation. An of instances to check for readability. An of instances to check for writability. An of instances to check for errors. - The time-out value, in microseconds. A -1 value indicates an infinite time-out. + The time-out value, in microseconds. A -1 value indicates an infinite time-out. Determines the status of one or more sockets. If you have made a non-blocking call to , the `checkerror` parameter identifies sockets that have not connected successfully. > [!NOTE] -> Use the method if you only want to determine the status of a single . +> Use the method if you only want to determine the status of a single . > [!NOTE] -> This method cannot detect certain kinds of connection problems, such as a broken network cable, or that the remote host was shut down ungracefully. You must attempt to send or receive data to detect these kinds of errors. +> This method cannot detect certain kinds of connection problems, such as a broken network cable, or that the remote host was shut down ungracefully. You must attempt to send or receive data to detect these kinds of errors. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. @@ -10515,14 +10415,14 @@ You must call the Bind method before performing this operation. ]]> - The , , and parameters are all or empty. At least one of , , or must contain at least one . + The , , and parameters are all or empty. At least one of , , or must contain at least one . An error occurred when attempting to access the socket. .NET 5 and later: One or more sockets are disposed. - The , , or parameter contains too many sockets. + The , , or parameter contains too many sockets. @@ -10557,12 +10457,12 @@ You must call the Bind method before performing this operation. An of instances to check for readability. An of instances to check for writability. An of instances to check for errors. - The timeout value. A value equal to -1 microseconds indicates an infinite timeout. + The timeout value. A value equal to -1 microseconds indicates an infinite timeout. Determines the status of one or more sockets. To be added. - The , , and parameters are all or empty. At least one of , , or must contain at least one . - The , , or parameter contains too many sockets. - The was less than -1 microseconds or greater than microseconds + The , , and parameters are all or empty. At least one of , , or must contain at least one . + The , , or parameter contains too many sockets. + The was less than -1 microseconds or greater than microseconds An error occurred when attempting to access the socket. One or more sockets was disposed. @@ -10620,7 +10520,7 @@ You must call the Bind method before performing this operation. An array of type that contains the data to be sent. Sends data to a connected . - The number of bytes sent to the . + The number of bytes sent to the . If you are using a connection-oriented protocol, will block until all of the bytes in the buffer are sent, unless a time-out was set by using . If the time-out value was exceeded, the call will throw a . In nonblocking mode, may complete successfully even if it sends less than the number of bytes in the buffer. It is your application's responsibility to keep track of the number of bytes sent and to retry the operation until the application sends the bytes in the buffer. There is also no guarantee that the data you send will appear on the network immediately. To increase network efficiency, the underlying system may delay transmission until a significant amount of outgoing data is collected. A successful completion of the method means that the underlying system has had room to buffer your data for a network send. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example demonstrates sending data on a connected . @@ -10657,7 +10555,7 @@ You must call the Bind method before performing this operation. is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -10713,7 +10611,7 @@ You must call the Bind method before performing this operation. A list of s of type that contains the data to be sent. Sends the set of buffers in the list to a connected . - The number of bytes sent to the . + The number of bytes sent to the . If you are using a connection-oriented protocol, will block until all of the bytes in the buffer are sent, unless a time-out was set by using . If the time-out value was exceeded, the call will throw a . In nonblocking mode, may complete successfully even if it sends less than the number of bytes in the buffer. It is your application's responsibility to keep track of the number of bytes sent and to retry the operation until the application sends the bytes in the buffer. There is also no guarantee that the data you send will appear on the network immediately. To increase network efficiency, the underlying system may delay transmission until a significant amount of outgoing data is collected. A successful completion of the method means that the underlying system has had room to buffer your data for a network send. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -10745,7 +10643,7 @@ You must call the Bind method before performing this operation. is empty. An error occurred when attempting to access the socket. See remarks section below. - The has been closed. + The has been closed. @@ -10781,7 +10679,7 @@ You must call the Bind method before performing this operation. A span of bytes that contains the data to be sent. Sends data to a connected . - The number of bytes sent to the . + The number of bytes sent to the . will block until all of the bytes in the buffer are sent, unless a time-out was set by using . If the time-out value was exceeded, the call will throw a . In nonblocking mode, may complete successfully even if it sends less than the number of bytes in the buffer. It is your application's responsibility to keep track of the number of bytes sent and to retry the operation until the application sends the bytes in the buffer. There's also no guarantee that the data you send will appear on the network immediately. To increase network efficiency, the underlying system may delay transmission until a significant amount of outgoing data is collected. A successful completion of the method means that the underlying system has had room to buffer your data for a network send. > [!NOTE] ->If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. -This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> [!NOTE] +> This member outputs trace information when you enable network tracing in your application. > [!IMPORTANT] ->The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. ]]> An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -10860,7 +10759,7 @@ This member outputs trace information when you enable network tracing in your ap An array of type that contains the data to be sent. A bitwise combination of the values. Sends data to a connected using the specified . - The number of bytes sent to the . + The number of bytes sent to the . will block until all of the bytes in the buffer are sent, unless a time-out was set by using . If the time-out value was exceeded, the call will throw a . In nonblocking mode, may complete successfully even if it sends less than the number of bytes in the buffer. It is your application's responsibility to keep track of the number of bytes sent and to retry the operation until the application sends the requested number of bytes. There is also no guarantee that the data you send will appear on the network immediately. To increase network efficiency, the underlying system may delay transmission until a significant amount of outgoing data is collected. A successful completion of the method means that the underlying system has had room to buffer your data for a network send. > [!NOTE] -> You must ensure that the size of your buffer does not exceed the maximum packet size of the underlying service provider. If it does, the datagram will not be sent and will throw a . If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> You must ensure that the size of your buffer does not exceed the maximum packet size of the underlying service provider. If it does, the datagram will not be sent and will throw a . If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example demonstrates sending data on a connected . @@ -10897,7 +10794,7 @@ This member outputs trace information when you enable network tracing in your ap is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -10955,7 +10852,7 @@ This member outputs trace information when you enable network tracing in your ap A list of s of type that contains the data to be sent. A bitwise combination of the values. Sends the set of buffers in the list to a connected , using the specified . - The number of bytes sent to the . + The number of bytes sent to the . will block until all of the bytes in the buffer are sent, unless a time-out was set by using . If the time-out value was exceeded, the call will throw a . In non-blocking mode, may complete successfully even if it sends less than the number of bytes in the buffer. It is your application's responsibility to keep track of the number of bytes sent and to retry the operation until the application sends the bytes in the buffer. There is also no guarantee that the data you send will appear on the network immediately. To increase network efficiency, the underlying system may delay transmission until a significant amount of outgoing data is collected. A successful completion of the method means that the underlying system has had room to buffer your data for a network send. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -10985,7 +10882,7 @@ This member outputs trace information when you enable network tracing in your ap is empty. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -11023,16 +10920,10 @@ This member outputs trace information when you enable network tracing in your ap A span of bytes that contains the data to be sent. A bitwise combination of the enumeration values that specifies send and receive behaviors. Sends data to a connected using the specified . - The number of bytes sent to the . - - - + The number of bytes sent to the . + To be added. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -11083,10 +10974,10 @@ This member outputs trace information when you enable network tracing in your ap An array of type that contains the data to be sent. - The number of bytes to send. + The number of bytes to send. A bitwise combination of the values. Sends the specified number of bytes of data to a connected , using the specified . - The number of bytes sent to the . + The number of bytes sent to the . will > [!NOTE] > You must ensure that the size does not exceed the maximum packet size of the underlying service provider. If it does, the datagram won't be sent and will throw a . If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. -This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - > [!IMPORTANT] ->The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. + +> [!NOTE] +> This member outputs trace information when you enable network tracing in your application. ## Examples @@ -11128,7 +11020,7 @@ The following code example sends the data found in buffer, and specifies - The has been closed. + The has been closed. @@ -11188,7 +11080,7 @@ The following code example sends the data found in buffer, and specifies A bitwise combination of the values. A object that stores the socket error. Sends the set of buffers in the list to a connected , using the specified . - The number of bytes sent to the . + The number of bytes sent to the . will block until all of the bytes in the buffer are sent, unless a time-out was set by using . If the time-out value was exceeded, the call will throw a . In non-blocking mode, may complete successfully even if it sends less than the number of bytes in the buffer. It is your application's responsibility to keep track of the number of bytes sent and to retry the operation until the application sends the bytes in the buffer. There is also no guarantee that the data you send will appear on the network immediately. To increase network efficiency, the underlying system may delay transmission until a significant amount of outgoing data is collected. A successful completion of the method means that the underlying system has had room to buffer your data for a network send. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -11218,7 +11110,7 @@ The following code example sends the data found in buffer, and specifies is empty. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -11258,7 +11150,7 @@ The following code example sends the data found in buffer, and specifies A bitwise combination of the enumeration values that specifies send and receive behaviors. When this method returns, contains one of the enumeration values that defines error codes for the socket. Sends data to a connected using the specified . - The number of bytes sent to the . + The number of bytes sent to the . will block until all of the bytes in the buffer are sent, unless a time-out was set by using . If the time-out value was exceeded, the call will throw a . In nonblocking mode, may complete successfully even if it sends less than the number of bytes in the buffer. It is your application's responsibility to keep track of the number of bytes sent and to retry the operation until the application sends the bytes in the buffer. There's also no guarantee that the data you send will appear on the network immediately. To increase network efficiency, the underlying system may delay transmission until a significant amount of outgoing data is collected. A successful completion of the method means that the underlying system has had room to buffer your data for a network send. > [!NOTE] ->If you receive a , use the property to obtain the specific error code. After you've obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. - -This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> If you receive a , use the property to obtain the specific error code. After you've obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!IMPORTANT] ->The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. + +> [!NOTE] +> This member outputs trace information when you enable network tracing in your application. ]]> An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -11336,11 +11229,11 @@ This member outputs trace information when you enable network tracing in your ap An array of type that contains the data to be sent. - The position in the data buffer at which to begin sending data. - The number of bytes to send. + The position in the data buffer at which to begin sending data. + The number of bytes to send. A bitwise combination of the values. Sends the specified number of bytes of data to a connected , starting at the specified offset, and using the specified . - The number of bytes sent to the . + The number of bytes sent to the . will block until the requested number of bytes are sent, unless a time-out was set by using . If the time-out value was exceeded, the call will throw a . In nonblocking mode, may complete successfully even if it sends less than the number of bytes you request. It is your application's responsibility to keep track of the number of bytes sent and to retry the operation until the application sends the requested number of bytes. There is also no guarantee that the data you send will appear on the network immediately. To increase network efficiency, the underlying system may delay transmission until a significant amount of outgoing data is collected. A successful completion of the method means that the underlying system has had room to buffer your data for a network send. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example specifies the data buffer, an offset, a size, and for sending data to a connected . @@ -11398,7 +11289,7 @@ This member outputs trace information when you enable network tracing in your ap -or- An operating system error occurs while accessing the . - The has been closed. + The has been closed. @@ -11450,12 +11341,12 @@ This member outputs trace information when you enable network tracing in your ap An array of type that contains the data to be sent. - The position in the data buffer at which to begin sending data. - The number of bytes to send. + The position in the data buffer at which to begin sending data. + The number of bytes to send. A bitwise combination of the values. A object that stores the socket error. Sends the specified number of bytes of data to a connected , starting at the specified offset, and using the specified . - The number of bytes sent to the . + The number of bytes sent to the . will block until the requested number of bytes are sent, unless a time-out was set by using . If the time-out value was exceeded, the call will throw a . In nonblocking mode, may complete successfully even if it sends less than the number of bytes you request. It is your application's responsibility to keep track of the number of bytes sent and to retry the operation until the application sends the requested number of bytes. There is also no guarantee that the data you send will appear on the network immediately. To increase network efficiency, the underlying system may delay transmission until a significant amount of outgoing data is collected. A successful completion of the method means that the underlying system has had room to buffer your data for a network send. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. +> The successful completion of a send does not indicate that the data was successfully delivered. If no buffer space is available within the transport system to hold the data to be transmitted, send will block unless the socket has been placed in nonblocking mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example specifies the data buffer, an offset, a size, and for sending data to a connected . @@ -11513,7 +11402,7 @@ This member outputs trace information when you enable network tracing in your ap -or- An operating system error occurs while accessing the . - The has been closed. + The has been closed. @@ -11552,12 +11441,12 @@ This member outputs trace information when you enable network tracing in your ap - The buffer for the data to send. + The buffer for the data to send. Sends data on a connected socket. An asynchronous task that completes with the number of bytes sent. To be added. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -11600,7 +11489,7 @@ This member outputs trace information when you enable network tracing in your ap is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -11643,7 +11532,7 @@ This member outputs trace information when you enable network tracing in your ap - The object to use for this asynchronous socket operation. + The object to use for this asynchronous socket operation. Sends data asynchronously to a connected object. if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. @@ -11659,13 +11548,13 @@ This member outputs trace information when you enable network tracing in your ap The following properties and events on the object are required to successfully call this method: -- or +- or -- if is set +- if is set -- if is set +- if is set -- +- The caller may set the property to any user state object desired before calling the method, so that the information will be retrievable in the callback method. If the callback needs more information than a single object, a small class can be created to hold the other required state information as members. @@ -11679,10 +11568,10 @@ This member outputs trace information when you enable network tracing in your ap ]]> - The or properties on the parameter must reference valid buffers. One or the other of these properties may be set, but not both at the same time. + The or properties on the parameter must reference valid buffers. One or the other of these properties may be set, but not both at the same time. A socket operation was already in progress using the object specified in the parameter. - The has been closed. - The is not yet connected or was not obtained via an , ,or , method. + The has been closed. + The is not yet connected or was not obtained via an , ,or , method. @@ -11726,13 +11615,13 @@ This member outputs trace information when you enable network tracing in your ap - The buffer for the data to send. + The buffer for the data to send. A bitwise combination of SocketFlags values that will be used when sending the data. Sends data on a connected socket. An asynchronous task that completes with the number of bytes sent. To be added. An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -11778,7 +11667,7 @@ This member outputs trace information when you enable network tracing in your ap is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -11807,12 +11696,12 @@ This member outputs trace information when you enable network tracing in your ap - The buffer for the data to send. + The buffer for the data to send. A cancellation token that can be used to cancel the asynchronous operation. Sends data on a connected socket. An asynchronous task that completes with the number of bytes sent. To be added. - The cancellation token was canceled. This exception is stored into the returned task. + The cancellation token was canceled. This exception is stored into the returned task. @@ -11843,15 +11732,15 @@ This member outputs trace information when you enable network tracing in your ap - The buffer for the data to send. + The buffer for the data to send. A bitwise combination of SocketFlags values that will be used when sending the data. A cancellation token that can be used to cancel the asynchronous operation. Sends data on a connected socket. An asynchronous task that completes with the number of bytes sent. To be added. An error occurred when attempting to access the socket. - The has been closed. - The cancellation token was canceled. This exception is stored into the returned task. + The has been closed. + The cancellation token was canceled. This exception is stored into the returned task. @@ -11899,8 +11788,6 @@ This member outputs trace information when you enable network tracing in your ap ## Remarks A larger buffer size might delay the recognition of connection difficulties. Consider increasing the buffer size if you are transferring large files, or you are using a high bandwidth, high latency connection (such as a satellite broadband provider.) - - ## Examples The following code example demonstrates the use of the property. @@ -11909,8 +11796,8 @@ This member outputs trace information when you enable network tracing in your ap ]]> An error occurred when attempting to access the socket. - The has been closed. - The value specified for a set operation is less than 0. + The has been closed. + The value specified for a set operation is less than 0. @@ -11980,10 +11867,10 @@ This member outputs trace information when you enable network tracing in your ap If you are using a connection-oriented protocol, blocks until the file is sent. In nonblocking mode, may complete successfully before the entire file has been sent. There is no guarantee that the data you send will appear on the network immediately. To increase network efficiency, the underlying system may delay transmission until a significant amount of outgoing data is collected. A successful completion of the method means that the underlying system has had room to buffer your data for a network send. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example creates and connects a socket and then sends a file to the remote host. The file "test.txt" is located in the root directory of the local machine. @@ -11992,10 +11879,10 @@ This member outputs trace information when you enable network tracing in your ap ]]> - The socket is not connected to a remote host. - The object has been closed. - The object is not in blocking mode and cannot accept this synchronous call. - The file was not found. + The socket is not connected to a remote host. + The object has been closed. + The object is not in blocking mode and cannot accept this synchronous call. + The file was not found. An error occurred when attempting to access the socket. @@ -12042,9 +11929,9 @@ This member outputs trace information when you enable network tracing in your ap - The path and name of the file to be sent. This parameter can be . - The data to be sent before the file is sent. This parameter can be . - The data to be sent after the file is sent. This parameter can be . + The path and name of the file to be sent. This parameter can be . + The data to be sent before the file is sent. This parameter can be . + The data to be sent after the file is sent. This parameter can be . A bitwise combination of the enumeration values that specifies how the file is transferred. Sends the file and buffers of data to a connected object using the specified value. @@ -12064,10 +11951,10 @@ This member outputs trace information when you enable network tracing in your ap If you are using a connection-oriented protocol, blocks until the entire file is sent. In nonblocking mode, may complete successfully before the entire file has been sent. There is no guarantee that the data you send will appear on the network immediately. To increase network efficiency, the underlying system may delay transmission until a significant amount of outgoing data is collected. A successful completion of the method means that the underlying system has had room to buffer your data for a network send. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example creates and connects a socket. The file "test.txt" is located in the root directory of the local machine. In this example, we create a prebuffer and postbuffer of data and send them to the remote host with the file. The default are used. @@ -12076,14 +11963,14 @@ This member outputs trace information when you enable network tracing in your ap ]]> - The operating system is not Windows NT or later. + The operating system is not Windows NT or later. -or- The socket is not connected to a remote host. - The object has been closed. - The object is not in blocking mode and cannot accept this synchronous call. - The file was not found. + The object has been closed. + The object is not in blocking mode and cannot accept this synchronous call. + The file was not found. An error occurred when attempting to access the socket. @@ -12130,10 +12017,10 @@ This member outputs trace information when you enable network tracing in your ap One or more of values. Sends the file and buffers of data to a connected object using the specified value. To be added. - The object has been closed. - The object is not connected to a remote host. - The object is not in blocking mode and cannot accept this synchronous call. - The file was not found. + The object has been closed. + The object is not connected to a remote host. + The object is not in blocking mode and cannot accept this synchronous call. + The file was not found. An error occurred when attempting to access the socket. @@ -12169,11 +12056,11 @@ This member outputs trace information when you enable network tracing in your ap Sends the file to a connected object. A value task that represents the asynchronous send file operation. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - The object has been closed. - The object is not connected to a remote host. - The file was not found. + The object has been closed. + The object is not connected to a remote host. + The file was not found. An error occurred when attempting to access the socket. - The cancellation token was canceled. This exception is stored into the returned task. + The cancellation token was canceled. This exception is stored into the returned task. @@ -12221,11 +12108,11 @@ This member outputs trace information when you enable network tracing in your ap Sends the file and buffers of data to a connected object using the specified value. A value task that represents the asynchronous send file operation. To be added. - The object has been closed. - The object is not connected to a remote host. - The file was not found. + The object has been closed. + The object is not connected to a remote host. + The file was not found. An error occurred when attempting to access the socket. - The cancellation token was canceled. This exception is stored into the returned task. + The cancellation token was canceled. This exception is stored into the returned task. @@ -12268,7 +12155,7 @@ This member outputs trace information when you enable network tracing in your ap - The object to use for this asynchronous socket operation. + The object to use for this asynchronous socket operation. Sends a collection of files or in memory data buffers asynchronously to a connected object. if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. @@ -12288,9 +12175,9 @@ This member outputs trace information when you enable network tracing in your ap The following properties and events on the object are required to successfully call this method: -- +- -- +- The caller may set the property to any user state object desired before calling the method, so that the information will be retrievable in the callback method. If the callback needs more information than a single object, a small class can be created to hold the other required state information as members. @@ -12306,10 +12193,10 @@ This member outputs trace information when you enable network tracing in your ap ]]> - The file specified in the property was not found. + The file specified in the property was not found. A socket operation was already in progress using the object specified in the parameter. - The is not connected to a remote host. - The has been closed. + The is not connected to a remote host. + The has been closed. A connectionless is being used and the file being sent exceeds the maximum packet size of the underlying transport. @@ -12356,7 +12243,7 @@ This member outputs trace information when you enable network tracing in your ap Gets or sets a value that specifies the amount of time after which a synchronous call will time out. - The time-out value, in milliseconds. If you set the property with a value between 1 and 499, the value will be changed to 500. The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period. + The time-out value, in milliseconds. If you set the property with a value between 1 and 499, the value will be changed to 500. The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period. An error occurred when attempting to access the socket. - The has been closed. - The value specified for a set operation is less than -1. + The has been closed. + The value specified for a set operation is less than -1. @@ -12428,9 +12315,9 @@ This member outputs trace information when you enable network tracing in your ap An array of type that contains the data to be sent. - The that represents the destination for the data. + The that represents the destination for the data. Sends data to the specified endpoint. - The number of bytes sent. + The number of bytes sent. will block until the datagram is sent. If you want to send data to a broadcast address, you must first call the method and set the socket option to . You must also be sure that the number of bytes sent does not exceed the maximum packet size of the underlying service provider. If it does, the datagram will not be sent and will throw a . > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example sends a connectionless datagram to the specified remote host. @@ -12466,7 +12353,7 @@ This member outputs trace information when you enable network tracing in your ap is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -12511,14 +12398,14 @@ This member outputs trace information when you enable network tracing in your ap A span of bytes that contains the data to be sent. - The that represents the destination for the data. + The that represents the destination for the data. Sends data to the specified endpoint. - The number of bytes sent. + The number of bytes sent. To be added. remoteEP is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -12566,9 +12453,9 @@ This member outputs trace information when you enable network tracing in your ap An array of type that contains the data to be sent. A bitwise combination of the values. - The that represents the destination location for the data. + The that represents the destination location for the data. Sends data to a specific endpoint using the specified . - The number of bytes sent. + The number of bytes sent. will block until the datagram is sent. If you want to send data to a broadcast address, you must first call the method and set the socket option to . You must also be sure that the number of bytes sent does not exceed the maximum packet size of the underlying service provider. If it does, the datagram will not be sent and will throw a . > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example sends a connectionless datagram to the specified remote host. are passed to the method. @@ -12604,7 +12491,7 @@ This member outputs trace information when you enable network tracing in your ap is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -12651,14 +12538,14 @@ This member outputs trace information when you enable network tracing in your ap A span of bytes that contains the data to be sent. A bitwise combination of the values. - The that represents the destination for the data. + The that represents the destination for the data. Sends data to a specific endpoint using the specified . - The number of bytes sent. + The number of bytes sent. To be added. remoteEP is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -12697,14 +12584,14 @@ This member outputs trace information when you enable network tracing in your ap A span of bytes that contains the data to be sent. A bitwise combination of the values that will be used when sending the data. - The that represents the destination for the data. + The that represents the destination for the data. Sends data to a specific endpoint using the specified . - The number of bytes sent. + The number of bytes sent. To be added. is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -12752,11 +12639,11 @@ This member outputs trace information when you enable network tracing in your ap An array of type that contains the data to be sent. - The number of bytes to send. + The number of bytes to send. A bitwise combination of the values. - The that represents the destination location for the data. + The that represents the destination location for the data. Sends the specified number of bytes of data to the specified endpoint using the specified . - The number of bytes sent. + The number of bytes sent. will block until the datagram is sent. If you want to send data to a broadcast address, you must first call the method and set the socket option to . You must also be sure that the number of bytes sent does not exceed the maximum packet size of the underlying service provider. If it does, the datagram will not be sent and will throw a . > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example sends a connectionless datagram to the specified remote host. The size and are passed to the method. @@ -12791,9 +12678,9 @@ This member outputs trace information when you enable network tracing in your ap -or- is . - The specified exceeds the size of . + The specified exceeds the size of . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -12848,12 +12735,12 @@ This member outputs trace information when you enable network tracing in your ap An array of type that contains the data to be sent. - The position in the data buffer at which to begin sending data. - The number of bytes to send. + The position in the data buffer at which to begin sending data. + The number of bytes to send. A bitwise combination of the values. - The that represents the destination location for the data. + The that represents the destination location for the data. Sends the specified number of bytes of data to the specified endpoint, starting at the specified location in the buffer, and using the specified . - The number of bytes sent. + The number of bytes sent. will block until the datagram is sent. If you want to send data to a broadcast address, you must first call the method and set the socket option to . You must also be sure that the size does not exceed the maximum packet size of the underlying service provider. If it does, the datagram will not be sent and will throw a . > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example sends a connectionless datagram to the specified remote host. The offset, size, and are passed to the method. @@ -12908,7 +12795,7 @@ This member outputs trace information when you enable network tracing in your ap -or- An operating system error occurs while accessing the . - The has been closed. + The has been closed. A caller in the call stack does not have the required permissions. @@ -12958,7 +12845,7 @@ This member outputs trace information when you enable network tracing in your ap - The object to use for this asynchronous socket operation. + The object to use for this asynchronous socket operation. Sends data asynchronously to a specific remote host. if the I/O operation is pending. The event on the parameter will be raised upon completion of the operation. @@ -12974,15 +12861,15 @@ This member outputs trace information when you enable network tracing in your ap The following properties and events on the object are required to successfully call this method: -- +- -- +- -- +- -- +- -- +- The caller may set the property to any user state object desired before calling the method, so that the information will be retrievable in the callback method. If the callback needs more information than a single object, a small class can be created to hold the other required state information as members. @@ -12998,10 +12885,10 @@ This member outputs trace information when you enable network tracing in your ap ]]> - The cannot be null. + The cannot be null. A socket operation was already in progress using the object specified in the parameter. - The has been closed. - The protocol specified is connection-oriented, but the is not yet connected. + The has been closed. + The protocol specified is connection-oriented, but the is not yet connected. @@ -13045,15 +12932,15 @@ This member outputs trace information when you enable network tracing in your ap - The buffer for the data to send. - The remote host to which to send the data. + The buffer for the data to send. + The remote host to which to send the data. Sends data to the specified remote host. An asynchronous task that completes with the number of bytes sent. To be added. is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -13092,16 +12979,16 @@ This member outputs trace information when you enable network tracing in your ap - The buffer for the data to send. + The buffer for the data to send. A bitwise combination of SocketFlags values that will be used when sending the data. - The remote host to which to send the data. + The remote host to which to send the data. Sends data to the specified remote host. An asynchronous task that completes with the number of bytes sent. To be added. is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -13138,8 +13025,8 @@ This member outputs trace information when you enable network tracing in your ap - The buffer for the data to send. - The remote host to which to send the data. + The buffer for the data to send. + The remote host to which to send the data. A cancellation token that can be used to cancel the asynchronous operation. Sends data to the specified remote host. An asynchronous task that completes with the number of bytes sent. @@ -13147,8 +13034,8 @@ This member outputs trace information when you enable network tracing in your ap is . An error occurred when attempting to access the socket. - The has been closed. - The cancellation token was canceled. This exception is stored into the returned task. + The has been closed. + The cancellation token was canceled. This exception is stored into the returned task. @@ -13187,9 +13074,9 @@ This member outputs trace information when you enable network tracing in your ap - The buffer for the data to send. + The buffer for the data to send. A bitwise combination of SocketFlags values that will be used when sending the data. - The remote host to which to send the data. + The remote host to which to send the data. A cancellation token that can be used to cancel the asynchronous operation. Sends data to the specified remote host. An asynchronous task that completes with the number of bytes sent. @@ -13197,8 +13084,8 @@ This member outputs trace information when you enable network tracing in your ap is . An error occurred when attempting to access the socket. - The has been closed. - The cancellation token was canceled. This exception is stored into the returned task. + The has been closed. + The cancellation token was canceled. This exception is stored into the returned task. @@ -13235,9 +13122,9 @@ This member outputs trace information when you enable network tracing in your ap - The buffer for the data to send. + The buffer for the data to send. A bitwise combination of values that will be used when sending the data. - The that represents the destination for the data. + The that represents the destination for the data. A cancellation token that can be used to cancel the asynchronous operation. Sends data to a specific endpoint using the specified . An asynchronous task that completes with the number of bytes sent. @@ -13245,8 +13132,8 @@ This member outputs trace information when you enable network tracing in your ap is . An error occurred when attempting to access the socket. - The has been closed. - The cancellation token was canceled. This exception is stored into the returned task. + The has been closed. + The cancellation token was canceled. This exception is stored into the returned task. @@ -13293,7 +13180,7 @@ This member outputs trace information when you enable network tracing in your ap - The IP protection level to set on this socket. + The IP protection level to set on this socket. Sets the IP protection level on a socket. - The argument is set to . - The socket is not in the or address families. + The argument is set to . + The socket is not in the or address families. @@ -13350,9 +13237,9 @@ This member outputs trace information when you enable network tracing in your ap - The platform-defined option level. - The platform-defined option name. - The value to which the option should be set. + The platform-defined option level. + The platform-defined option name. + The value to which the option should be set. Sets a socket option value using platform-specific level and name identifiers. - The has been closed. + The has been closed. An error occurred when attempting to access the socket. @@ -13423,7 +13310,7 @@ The One of the values. One of the values. - The value of the option, represented as a . + The value of the option, represented as a . Sets the specified option to the specified value. options that can be set using this overload. -- - -- - -- - -- - -- - -- +- +- +- +- +- +- +- -- + options that can be set using this overload. - options that can be set using this overload. +- +- +- -- + options that can be set using this overload. -- +- +- +- -- + options that can be set using this overload. - options that can be set using this overload. +- -- +For more information on these options, refer to the enumeration. -- - -- - - options that can be set using this overload. - -- - - For more information on these options, refer to the enumeration. +> [!NOTE] +> If you receive a exception, use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> If you receive a exception, use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example opens a socket and enables the `DontLinger` and the `OutOfBandInline` socket options. @@ -13483,7 +13363,7 @@ The - The object has been closed. + The object has been closed. An error occurred when attempting to access the socket. @@ -13541,10 +13421,7 @@ The options determine the behavior of the current . Use this overload to set those options that require a byte array as an option value. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. - -> [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. ## Examples The following code example sets the and time-out values. @@ -13555,7 +13432,7 @@ The An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -13618,73 +13495,52 @@ The options that can be set using this overload. -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - - options that can be set using this overload. - -- - -- - -- - -- - -- - -- +- +- +- +- +- +- +- +- +- +- +- +- -- + options that can be set using this overload. -- +- +- +- +- +- +- +- +- - options that can be set using this overload. + options that can be set using this overload. -- +- +- +- -- + options that can be set using this overload. -- +- +- - options that can be set using this overload. + options that can be set using this overload. -- +- -- - - options that can be set using this overload. - -- - - For more information about these options, refer to the enumeration. +For more information about these options, refer to the enumeration. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example sets the and time-out values. @@ -13695,7 +13551,7 @@ The An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -13755,7 +13611,7 @@ The options determine the behavior of the current . Use this overload to set the , , and options. For the option, use for the `optionLevel` parameter. For and , use . If you want to get the current value of any of the options listed above, use the method. > [!NOTE] -> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. ## Examples The following code example sets the and time out values. @@ -13768,7 +13624,7 @@ The is . An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -13827,18 +13683,17 @@ The enumeration values that are valid for the `how` parameter. -|Value|Description| -|-----------|-----------------| -|Send|Disable sending on this .| -|Receive|Disable receiving on this .| -|Both|Disable both sending and receiving on this .| +| Value | Description | +|---------|------------------------------------------------------------------------------| +| Send | Disable sending on this . | +| Receive | Disable receiving on this . | +| Both | Disable both sending and receiving on this . | Setting `how` to specifies that subsequent calls to are not allowed. If you are using a connectionless , specifying will have no effect. - Setting `how` to specifies that subsequent calls to are not allowed. This has no effect on lower protocol layers. If you are using a connection-oriented protocol, the connection is terminated if either of the following conditions exist after a call to : + Setting `how` to specifies that subsequent calls to are not allowed. This has no effect on lower protocol layers. If you are using a connection-oriented protocol, the connection is terminated if either of the following conditions exist after a call to : - Data is in the incoming network buffer waiting to be received. - - More data has arrived. If you are using a connectionless protocol, datagrams are accepted and queued. However, if no buffer space is available for additional incoming datagrams, they will be discarded and no error will be returned to the sender. Using on a connectionless is not recommended. @@ -13846,10 +13701,10 @@ The disables both sends and receives as described above. > [!NOTE] -> If you receive a when calling the method, use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a when calling the method, use the property to obtain the specific error code. After you have obtained this code, refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example uses to disable the . @@ -13860,7 +13715,7 @@ The An error occurred when attempting to access the socket. - The has been closed. + The has been closed. @@ -14038,17 +13893,10 @@ The System.Boolean - Gets a value that indicates whether the Framework supports IPv6 for certain obsolete members. + Gets a value that indicates whether the framework supports IPv6 for certain obsolete members. - if the Framework supports IPv6 for certain obsolete methods; otherwise, . - - - + if the framework supports IPv6 for certain obsolete methods; otherwise, . + To be added. @@ -14091,7 +13939,7 @@ The Gets or sets a value that specifies the Time To Live (TTL) value of Internet Protocol (IP) packets sent by the . - The TTL value. + The TTL value. - The TTL value is a negative number. - The socket is not in the or families. + The TTL value is a negative number. + The socket is not in the or families. An error occurred when attempting to access the socket. This error is also returned when an attempt was made to set TTL to a value higher than 255. - The has been closed. + The has been closed. @@ -14163,21 +14011,10 @@ The System.Boolean - Gets or sets a value that specifies whether the socket should only use Overlapped I/O mode. On .NET 5+ (including .NET Core versions), the value is always . - - on .NET Framework if the uses only overlapped I/O; otherwise, . The default is . - - you intend to call on. Otherwise, the Framework may assign a completion port to the socket, which would prohibit the use of . - -On .NET 5+ (include .NET Core) versions, the value of this property is always `false`, and you cannot change its value. - - ]]> - - The socket has been bound to a completion port. + Gets or sets a value that specifies whether the socket should only use Overlapped I/O mode. + Always . + The value of this property is always `false`, and you cannot change its value. + The socket has been bound to a completion port.
diff --git a/xml/System.Net.Sockets/SocketAsyncEventArgs.xml b/xml/System.Net.Sockets/SocketAsyncEventArgs.xml index f8a0dac1e8a..2cbb8e889d6 100644 --- a/xml/System.Net.Sockets/SocketAsyncEventArgs.xml +++ b/xml/System.Net.Sockets/SocketAsyncEventArgs.xml @@ -100,9 +100,6 @@ - Network Programming in the .NET Framework - Network Tracing in the .NET Framework - Socket Performance Enhancements in Version 3.5 @@ -763,7 +760,7 @@ When the `disposing` parameter is `true`, this method releases all resources held by any managed objects that this references. This method invokes the `Dispose()` method of each referenced object. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> diff --git a/xml/System.Net.Sockets/SocketFlags.xml b/xml/System.Net.Sockets/SocketFlags.xml index ef768b2fd1f..2e33d853501 100644 --- a/xml/System.Net.Sockets/SocketFlags.xml +++ b/xml/System.Net.Sockets/SocketFlags.xml @@ -56,7 +56,7 @@ ## Examples The following example sends data and specifies `SocketFlags.None`. - + :::code language="csharp" source="~/snippets/csharp/System.Net.Sockets/Socket/Receive/source.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Net.Sockets/Socket/Receive/source.vb" id="Snippet3"::: diff --git a/xml/System.Net.Sockets/TcpClient.xml b/xml/System.Net.Sockets/TcpClient.xml index 53dc7ea94b0..95caa9f7e7e 100644 --- a/xml/System.Net.Sockets/TcpClient.xml +++ b/xml/System.Net.Sockets/TcpClient.xml @@ -69,7 +69,7 @@ - Create a `TcpClient` using the host name and port number of the remote host. This constructor will automatically attempt a connection. > [!NOTE] -> If you want to send connectionless datagrams in synchronous blocking mode, use the class. +> If you want to send connectionless datagrams in synchronous blocking mode, use the class. @@ -148,12 +148,7 @@ This constructor creates a new and allows the underlying service provider to assign the most appropriate local IP address and port number. You must first call the method before sending and receiving data. > [!NOTE] -> On .NET Framework, this constructor works only with IPv4 address types. - -> [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example demonstrates how to use the parameterless constructor to create a new . @@ -214,9 +209,7 @@ You must call the method before sending and receiving data. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example demonstrates how to create an instance of the class using a local endpoint. @@ -277,9 +270,7 @@ ## Remarks > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example demonstrates how to create an instance of the class. @@ -346,12 +337,10 @@ If IPv6 is enabled and the method is called to connect to a host that resolves to both IPv6 and IPv4 addresses, the connection to the IPv6 address will be attempted first before the IPv4 address. This may have the effect of delaying the time to establish the connection if the host is not listening on the IPv6 address. > [!NOTE] -> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example demonstrates how to create an instance of the class using a host name and port number. @@ -853,9 +842,7 @@ The `Available` property is a way to determine whether data is queued for readin Calling this method will eventually result in the close of the associated `Socket` and will also close the associated that is used to send and receive data if one was created. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example demonstrates closing a by calling the `Close` method. @@ -928,7 +915,7 @@ The `Available` property is a way to determine whether data is queued for readin > If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. > [!NOTE] > If you receive NotSupportedException with message `This protocol version is not supported` while using IPv6 address, then make sure you enabled IPv6 in constructor by passing . @@ -999,10 +986,10 @@ The `Available` property is a way to determine whether data is queued for readin Call this method to establish a synchronous remote host connection to the specified and port number. The method will block until it either connects or fails. After connecting with the remote host, use the method to obtain the underlying . Use this `NetworkStream` to send and receive data. > [!NOTE] -> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. > [!NOTE] > If you receive NotSupportedException with message `This protocol version is not supported` while using IPv6 address, then make sure you enabled IPv6 in constructor by passing . @@ -1074,10 +1061,10 @@ The `Available` property is a way to determine whether data is queued for readin This method is typically used immediately after a call to the method, which can return multiple IP addresses for a single host. Call the `Connect` method to establish a synchronous remote host connection to the host specified by the array of elements and the port number. The `Connect` method will block until it either connects or fails. After connecting with the remote host, use the method to obtain the underlying . Use this `NetworkStream` to send and receive data. > [!NOTE] -> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. > [!NOTE] > If you receive NotSupportedException with message `This protocol version is not supported` while using IPv6 address, then make sure you enabled IPv6 in constructor by passing . @@ -1152,12 +1139,10 @@ The `Available` property is a way to determine whether data is queued for readin If IPv6 is enabled and the `Connect(String, Int32)` method is called to connect to a host that resolves to both IPv6 and IPv4 addresses, the connection to the IPv6 address will be attempted first before the IPv4 address. This may have the effect of delaying the time to establish the connection if the host is not listening on the IPv6 address. > [!NOTE] -> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example uses the host name and port number to connect with a remote host. @@ -1228,7 +1213,7 @@ The `Available` property is a way to determine whether data is queued for readin > If you receive a , use to obtain the specific error code. After you've obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. > [!NOTE] > If you receive a `NotSupportedException` with the message "This protocol version is not supported" while using IPv6 address, make sure you enabled IPv6 in the constructor by passing . @@ -1292,10 +1277,10 @@ The `Available` property is a way to determine whether data is queued for readin Call this method to establish a synchronous remote host connection to the specified and port number as an asynchronous operation. After connecting with the remote host, use the method to obtain the underlying . Use this `NetworkStream` to send and receive data. > [!NOTE] -> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. > [!NOTE] > If you receive NotSupportedException with message `This protocol version is not supported` while using IPv6 address, then make sure you enabled IPv6 in constructor by passing . @@ -1365,10 +1350,10 @@ The `Available` property is a way to determine whether data is queued for readin This method is typically used immediately after a call to the method, which can return multiple IP addresses for a single host. Call this method to establish a synchronous remote host connection to the host specified by the array of elements and the port number as an asynchronous operation. After connecting with the remote host, use the method to obtain the underlying . Use this `NetworkStream` to send and receive data. > [!NOTE] -> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. > [!NOTE] > If you receive NotSupportedException with message `This protocol version is not supported` while using IPv6 address, then make sure you enabled IPv6 in constructor by passing . @@ -1427,10 +1412,10 @@ The `Available` property is a way to determine whether data is queued for readin Call this method to establish a synchronous remote host connection to the specified . Before you call `Connect`, you must create an instance of the `IPEndPoint` class using an IP address and a port number. Use this `IPEndPoint` as the `remoteEP` parameter. The `Connect` method will block until it either connects or fails. After connecting with the remote host, use the method to obtain the underlying . Use this `NetworkStream` to send and receive data. > [!NOTE] -> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. > [!NOTE] > If you receive NotSupportedException with message `This protocol version is not supported` while using IPv6 address, then make sure you enabled IPv6 in constructor by passing . @@ -1497,10 +1482,10 @@ The `Available` property is a way to determine whether data is queued for readin If IPv6 is enabled and the method is called to connect to a host that resolves to both IPv6 and IPv4 addresses, the connection to the IPv6 address will be attempted first before the IPv4 address. This may have the effect of delaying the time to establish the connection if the host is not listening on the IPv6 address. > [!NOTE] -> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . @@ -1559,10 +1544,10 @@ The `Available` property is a way to determine whether data is queued for readin Call this method to establish a synchronous remote host connection to the specified IP address and port number as an asynchronous operation. After connecting with the remote host, use the method to obtain the underlying . Use this `NetworkStream` to send and receive data. > [!NOTE] -> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. > [!NOTE] > If you receive NotSupportedException with message `This protocol version is not supported` while using IPv6 address, then make sure you enabled IPv6 in constructor by passing . @@ -1624,10 +1609,10 @@ The `Available` property is a way to determine whether data is queued for readin This method is typically used immediately after a call to the method, which can return multiple IP addresses for a single host. Call this method to establish a synchronous remote host connection to the host specified by the array of IP addresses and the port number as an asynchronous operation. After connecting with the remote host, use the method to obtain the underlying . Use this `NetworkStream` to send and receive data. > [!NOTE] -> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. > [!NOTE] > If you receive NotSupportedException with message `This protocol version is not supported` while using IPv6 address, then make sure you enabled IPv6 in constructor by passing . @@ -1692,10 +1677,10 @@ The `Available` property is a way to determine whether data is queued for readin If IPv6 is enabled and the method is called to connect to a host that resolves to both IPv6 and IPv4 addresses, the connection to the IPv6 address will be attempted first before the IPv4 address. This may have the effect of delaying the time to establish the connection if the host is not listening on the IPv6 address. > [!NOTE] -> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . @@ -1866,7 +1851,7 @@ The `Available` property is a way to determine whether data is queued for readin When the `disposing` parameter is `true`, this method releases all resources held by any managed objects that this references. It does this by invoking the `Dispose()` method of each referenced object. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -1926,7 +1911,7 @@ The `Available` property is a way to determine whether data is queued for readin This method blocks until the operation is complete. To perform this operation synchronously, use a method. > [!NOTE] -> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. ]]> @@ -2102,12 +2087,10 @@ The `GetStream` method returns a that yo You must call the method first, or the method will throw an . After you have obtained the `NetworkStream`, call the method to send data to the remote host. Call the method to receive data arriving from the remote host. Both of these methods block until the specified operation is performed. You can avoid blocking on a read operation by checking the property. A `true` value means that data has arrived from the remote host and is available for reading. In this case, is guaranteed to complete immediately. If the remote host has shutdown its connection, will immediately return with zero bytes. > [!NOTE] -> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use to obtain the specific error code. After you have obtained this code, you can refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example uses `GetStream` to obtain the underlying . After obtaining the , it sends and receives using its and methods. diff --git a/xml/System.Net.Sockets/TcpListener.xml b/xml/System.Net.Sockets/TcpListener.xml index 71769119f1e..552ffca141f 100644 --- a/xml/System.Net.Sockets/TcpListener.xml +++ b/xml/System.Net.Sockets/TcpListener.xml @@ -72,7 +72,7 @@ Call the method to close the . > [!NOTE] -> The method does not close any accepted connections. You are responsible for closing these separately. +> The method does not close any accepted connections. You are responsible for closing these separately. @@ -220,9 +220,7 @@ Call the method to begin listening for incoming connection attempts. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example creates an instance of the class using the local endpoint. @@ -289,9 +287,7 @@ Call the method to begin listening for incoming connection attempts. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example creates an instance of the class using a local IP address and port number. @@ -358,9 +354,7 @@ The returned is initialized with the IP address and port number of the remote host. You can use any of the and methods available in the class to communicate with the remote host. When you are finished using the , be sure to call its method. If your application is relatively simple, consider using the method rather than the method. provides you with simple methods for sending and receiving data over a network in blocking synchronous mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples In the following code example, the method is used to return a . This is used to communicate with the newly connected client. @@ -424,9 +418,7 @@ The returned in is initialized with the IP address and port number of the remote host. You can use any of the and methods available in the class to communicate with the remote host. When you are finished using the , be sure to call its method. If your application is relatively simple, consider using the method rather than the method. provides you with simple methods for sending and receiving data over a network in blocking synchronous mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . +> This member outputs trace information when you enable network tracing in your application. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . ]]> @@ -481,9 +473,7 @@ The returned in is initialized with the IP address and port number of the remote host. You can use any of the and methods available in the class to communicate with the remote host. When you are finished using the , be sure to call its method. If your application is relatively simple, consider using the method rather than the method. provides you with simple methods for sending and receiving data over a network in blocking synchronous mode. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . +> This member outputs trace information when you enable network tracing in your application. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . ]]> @@ -539,9 +529,7 @@ Use the method to obtain the underlying of the returned . The will provide you with methods for sending and receiving with the remote host. When you are through with the , be sure to call its method. If you want greater flexibility than a offers, consider using . > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples In the following code example, the method is used to return a . This is used to communicate with the newly connected client. @@ -607,9 +595,7 @@ Use the method to obtain the underlying of the returned in the . The will provide you with methods for sending and receiving with the remote host. When you are through with the , be sure to call its method. If you want greater flexibility than a offers, consider using or . > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . +> This member outputs trace information when you enable network tracing in your application. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . ]]> @@ -666,9 +652,7 @@ Use the method to obtain the underlying of the returned in the . The will provide you with methods for sending and receiving with the remote host. When you are through with the , be sure to call its method. If you want greater flexibility than a offers, consider using or . > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . +> This member outputs trace information when you enable network tracing in your application. This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . ]]> @@ -859,15 +843,13 @@ For detailed information about using the asynchronous programming model, see [Calling Synchronous Methods Asynchronously](/dotnet/standard/asynchronous-programming-patterns/calling-synchronous-methods-asynchronously). > [!NOTE] -> You can call the property of the returned to identify the remote host's network address and port number. +> You can call the property of the returned to identify the remote host's network address and port number. > [!NOTE] -> If you receive a , use the property to obtain the specific error code and refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code and refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - ]]> +> This member outputs trace information when you enable network tracing in your application. ]]> An error occurred while attempting to access the socket. The has been closed. @@ -935,12 +917,10 @@ For detailed information about using the asynchronous programming model, see [Calling Synchronous Methods Asynchronously](/dotnet/standard/asynchronous-programming-patterns/calling-synchronous-methods-asynchronously). > [!NOTE] -> If you receive a , use the property to obtain the specific error code and refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code and refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - ]]> +> This member outputs trace information when you enable network tracing in your application. ]]> An error occurred while attempting to access the socket. The has been closed. @@ -1071,15 +1051,13 @@ This method blocks until the operation is complete. To perform this operation synchronously, use the method. > [!NOTE] -> You can call the property of the returned to identify the remote host's network address and port number. +> You can call the property of the returned to identify the remote host's network address and port number. > [!NOTE] -> If you receive a , use the property to obtain the specific error code and refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code and refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - ]]> +> This member outputs trace information when you enable network tracing in your application. ]]> The underlying has been closed. The parameter is . @@ -1139,15 +1117,13 @@ This method blocks until the operation is complete. To perform this operation synchronously, use the method. > [!NOTE] -> You can call the property of the underlying socket () to identify the remote host's network address and port number. +> You can call the property of the underlying socket () to identify the remote host's network address and port number. > [!NOTE] -> If you receive a , use the property to obtain the specific error code and refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> If you receive a , use the property to obtain the specific error code and refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ]]> @@ -1386,7 +1362,7 @@ creates a to listen for incoming client connection requests. Classes deriving from can use this property to get this . Use the underlying returned by the property if you require access beyond that which provides. > [!NOTE] -> The property only returns the used to listen for incoming client connection requests. Use the method to accept a pending connection request and obtain a for sending and receiving data. You can also use the method to accept a pending connection request and obtain a for sending and receiving data. +> The property only returns the used to listen for incoming client connection requests. Use the method to accept a pending connection request and obtain a for sending and receiving data. You can also use the method to accept a pending connection request and obtain a for sending and receiving data. @@ -1464,9 +1440,7 @@ Use the method to close the and stop listening. You are responsible for closing your accepted connections separately. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example demonstrates how is used to listen for incoming client connection attempts. @@ -1536,12 +1510,10 @@ Use the method to close the and stop listening. You are responsible for closing your accepted connections separately. > [!NOTE] -> Use the property to obtain the specific error code and refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. +> Use the property to obtain the specific error code and refer to the [Windows Sockets version 2 API error code](/windows/desktop/winsock/windows-sockets-error-codes-2) documentation for a detailed description of the error. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example demonstrates how is used to listen for incoming client connection attempts. @@ -1608,9 +1580,7 @@ closes the listener. Any unaccepted connection requests in the queue will be lost. Remote hosts waiting for a connection to be accepted will throw a . You are responsible for closing your accepted connections separately. > [!NOTE] -> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](/dotnet/framework/network-programming/network-tracing). - - +> This member outputs trace information when you enable network tracing in your application. ## Examples The following code example demonstrates using the method to close the underlying . diff --git a/xml/System.Net.WebSockets/WebSocket.xml b/xml/System.Net.WebSockets/WebSocket.xml index f670b4f2c90..3c58fb629c1 100644 --- a/xml/System.Net.WebSockets/WebSocket.xml +++ b/xml/System.Net.WebSockets/WebSocket.xml @@ -749,9 +749,9 @@ Exactly one send and one receive is supported on each - Returns a value that indicates if the WebSocket instance is targeting .NET Framework 4.5. + Returns a value that indicates if the WebSocket instance targets .NET Framework 4.5. - if the is targeting .NET Framework 4.5; otherwise, . + if the targets .NET Framework 4.5; otherwise, . To be added. @@ -940,8 +940,8 @@ Exactly one send and one receive is supported on each [<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>] - [System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.")] - [<System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.")>] + [System.Obsolete("This API supports the .NET infrastructure and is not intended to be used directly from your code.")] + [<System.Obsolete("This API supports the .NET infrastructure and is not intended to be used directly from your code.")>]