Begins an asynchronous request for a remote host connection. The host is specified by a host name and a port number.
- Parameters
-
host | The name of the remote host. |
port | The port number of the remote host. |
callback | The xtd::async_callback delegate. |
state | An object that contains state information for this request. |
- Returns
- An xtd::iasync_result that references the asynchronous connection.
- Exceptions
-
- Note
- If you receive a xtd::net::sockets::socket_exception exception, use the xtd::net::sockets::socket_exception::error_code property to obtain the specific error code. After you have obtained this code, refer to the Windows Sockets version 2 API error code documentation in the MSDN library for a detailed description of the error.
-
If this socket has previously been disconnected, then xtd::net::sockets::socket::begin_connect must be called on a thread that will not exit until the operation is complete. This is a limitation of the underlying provider. Also the xtd::net::end_point that is used must be different.