xtd::sptr< xtd::iasync_result > xtd::net::sockets::socket::begin_connect | ( | const xtd::net::ip_address & | address, |
uint16 | port, | ||
xtd::async_callback | callback, | ||
const std::any & | state | ||
) |
Begins an asynchronous request for a remote host connection. The host is specified by an xtd::net::ip_address and a port number.
address | The xtd::net::ip_address 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. |
xtd::object_closed_exception | The xtd::net::sockets::socket has been closed. |
xtd::invalid_operation_exception | The accepting socket is not listening for connections. You must call xtd::net::sockets::socket::bind and xtd::net::sockets::socket::listen before calling xtd::net::sockets::socket::accept(). |