System.Net.Sockets.TcpClient.EndConnect Method

Ends a pending asynchronous connection attempt.

Syntax

public void EndConnect (IAsyncResult asyncResult)

Parameters

asyncResult
An IAsyncResult object returned by a call to erload:System.Net.Sockets.TcpClient.BeginConnect.

Remarks

This method blocks until the operation is complete. To perform this operation synchronously, use a erload:System.Net.Sockets.TcpClient.Connect method.

Note:

If you receive a System.Net.Sockets.SocketException, use SocketException.ErrorCode to obtain the specific error code. After you have obtained this code, you can refer to the Windows Sockets version 2 API error code documentation in the MSDN library at tp://msdn.microsoft.com/library for a detailed description of the error.

Requirements

Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0