TcpClient::EndConnect Method (IAsyncResult^)
Ends a pending asynchronous connection attempt.
Assembly: System (in System.dll)
Parameters
- asyncResult
-
Type:
System::IAsyncResult^
An IAsyncResult object returned by a call to BeginConnect.
| Exception | Condition |
|---|---|
| ArgumentNullException | The asyncResult parameter is null. |
| ArgumentException | The asyncResult parameter was not returned by a call to a BeginConnect method. |
| InvalidOperationException | The EndConnect method was previously called for the asynchronous connection. |
| SocketException | An error occurred when attempting to access the Socket. See the Remarks section for more information. |
| ObjectDisposedException | The underlying Socket has been closed. |
This method blocks until the operation is complete. To perform this operation synchronously, use a Connect method.
Note |
|---|
If you receive a 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 http://msdn.microsoft.com/library for a detailed description of the error. |
Available since 2.0
