Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 59 additions & 3 deletions xml/System.Net.Sockets/TcpClient.xml
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,9 @@ The `Available` property is a way to determine whether data is queued for readin
This method does not block until the operation completes. To block until the operation completes, use one of the <xref:System.Net.Sockets.TcpClient.Connect%2A> method overloads.

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 NotSupportedException with message `This protocol version is not supported` while using IPv6 address, then make sure you enabled IPv6 in constructor by passing <xref:System.Net.Sockets.AddressFamily.InterNetworkV6>.


## Examples
Expand Down Expand Up @@ -598,6 +600,8 @@ 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 <xref:System.Net.Dns.BeginGetHostAddresses%2A> method, which can return multiple IP addresses for a single host.

> [!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 <xref:System.Net.Sockets.AddressFamily.InterNetworkV6>.


## Examples
Expand Down Expand Up @@ -873,6 +877,8 @@ The `Available` property is a way to determine whether data is queued for readin
> [!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)

> [!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 <xref:System.Net.Sockets.AddressFamily.InterNetworkV6>.


## Examples
Expand Down Expand Up @@ -943,6 +949,8 @@ The `Available` property is a way to determine whether data is queued for readin
> [!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).

> [!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 <xref:System.Net.Sockets.AddressFamily.InterNetworkV6>.


## Examples
Expand Down Expand Up @@ -1013,6 +1021,8 @@ The `Available` property is a way to determine whether data is queued for readin
> [!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).

> [!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 <xref:System.Net.Sockets.AddressFamily.InterNetworkV6>.


## Examples
Expand Down Expand Up @@ -1142,7 +1152,23 @@ The `Available` property is a way to determine whether data is queued for readin
<param name="remoteEP">The <see cref="T:System.Net.IPEndPoint" /> to which you intend to connect.</param>
<summary>Connects the client to a remote TCP host using the specified endpoint as an asynchronous operation.</summary>
<returns>A task representing the asynchronous operation.</returns>
<remarks>To be added.</remarks>
<format type="text/markdown"><![CDATA[

## Remarks
This operation will not block. The returned Returns <xref:System.Threading.Tasks.Task> object will complete after the TCP connection has been established. This method does not block the calling thread while the connection request is underway.

Call this method to establish a synchronous remote host connection to the specified <xref:System.Net.IPEndPoint>. 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 <xref:System.Net.Sockets.TcpClient.GetStream%2A> method to obtain the underlying <xref:System.Net.Sockets.NetworkStream>. Use this `NetworkStream` to send and receive data.

> [!NOTE]
> If you receive a <xref:System.Net.Sockets.SocketException>, use <xref:System.Net.Sockets.SocketException.ErrorCode%2A?displayProperty=nameWithType> 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).

> [!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 <xref:System.Net.Sockets.AddressFamily.InterNetworkV6>.

]]></format>
</Docs>
</Member>
<Member MemberName="ConnectAsync">
Expand Down Expand Up @@ -1199,6 +1225,9 @@ The `Available` property is a way to determine whether data is queued for readin
> [!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).

> [!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 <xref:System.Net.Sockets.AddressFamily.InterNetworkV6>.

]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="address" /> parameter is <see langword="null" />.</exception>
Expand Down Expand Up @@ -1263,6 +1292,9 @@ The `Available` property is a way to determine whether data is queued for readin
> [!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).

> [!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 <xref:System.Net.Sockets.AddressFamily.InterNetworkV6>.

]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="ipAddresses" /> parameter is <see langword="null" />.</exception>
Expand Down Expand Up @@ -1302,7 +1334,25 @@ The `Available` property is a way to determine whether data is queued for readin
<param name="cancellationToken">A cancellation token used to propagate notification that this operation should be canceled.</param>
<summary>Connects the client to a remote TCP host using the specified endpoint as an asynchronous operation.</summary>
<returns>A task representing the asynchronous operation.</returns>
<remarks>To be added.</remarks>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
This operation will not block. The returned Returns <xref:System.Threading.Tasks.Task> object will complete after the TCP connection has been established. This method does not block the calling thread while the connection request is underway.

Call this method to establish a synchronous remote host connection to the specified <xref:System.Net.IPEndPoint>. 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 <xref:System.Net.Sockets.TcpClient.GetStream%2A> method to obtain the underlying <xref:System.Net.Sockets.NetworkStream>. Use this `NetworkStream` to send and receive data.

> [!NOTE]
> If you receive a <xref:System.Net.Sockets.SocketException>, use <xref:System.Net.Sockets.SocketException.ErrorCode%2A?displayProperty=nameWithType> 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).

> [!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 <xref:System.Net.Sockets.AddressFamily.InterNetworkV6>.

]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ConnectAsync">
Expand Down Expand Up @@ -1417,6 +1467,9 @@ The `Available` property is a way to determine whether data is queued for readin
> [!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).

> [!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 <xref:System.Net.Sockets.AddressFamily.InterNetworkV6>.

]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="address" /> parameter is <see langword="null" />.</exception>
Expand Down Expand Up @@ -1472,6 +1525,9 @@ The `Available` property is a way to determine whether data is queued for readin
> [!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).

> [!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 <xref:System.Net.Sockets.AddressFamily.InterNetworkV6>.

]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="ipAddresses" /> parameter is <see langword="null" />.</exception>
Expand Down