System::Net::Sockets::Socket::BeginConnect 方法

Socket::BeginConnect(String, int32_t, AsyncCallback, System::SharedPtr<Object>) method

发起异步连接操作。

System::SharedPtr<IAsyncResult> System::Net::Sockets::Socket::BeginConnect(String host, int32_t port, AsyncCallback requestCallback, System::SharedPtr<Object> state)
参数类型描述
hostString远程主机名。
portint32_t远程主机的端口号。
requestCallbackAsyncCallback当操作完成时将被调用的回调。
stateSystem::SharedPtr<Object>用户提供的数据,用于唯一标识每个异步连接操作。

ReturnValue

表示已发起的异步连接操作的 IAsyncResult 对象。

另见

Socket::BeginConnect(System::ArrayPtr<System::SharedPtr<IPAddress>>, int32_t, AsyncCallback, System::SharedPtr<Object>) method

发起异步连接操作。

System::SharedPtr<IAsyncResult> System::Net::Sockets::Socket::BeginConnect(System::ArrayPtr<System::SharedPtr<IPAddress>> addresses, int32_t port, AsyncCallback requestCallback, System::SharedPtr<Object> state)
参数类型描述
addressesSystem::ArrayPtr<System::SharedPtr<IPAddress>>远程主机的 IP 地址。
portint32_t远程主机的端口号。
requestCallbackAsyncCallback当操作完成时将被调用的回调。
stateSystem::SharedPtr<Object>用户提供的数据,用于唯一标识每个异步连接操作。

ReturnValue

表示已发起的异步连接操作的 IAsyncResult 对象。

另见

Socket::BeginConnect(System::SharedPtr<EndPoint>, AsyncCallback, System::SharedPtr<Object>) method

发起异步连接操作。

System::SharedPtr<IAsyncResult> System::Net::Sockets::Socket::BeginConnect(System::SharedPtr<EndPoint> remoteEP, AsyncCallback callback, System::SharedPtr<Object> state)
参数类型描述
remoteEPSystem::SharedPtr<EndPoint>远程端点。
回调AsyncCallback当操作完成时将被调用的回调。
stateSystem::SharedPtr<Object>用户提供的数据,用于唯一标识每个异步连接操作。

ReturnValue

表示已发起的异步连接操作的 IAsyncResult 对象。

另见

Socket::BeginConnect(System::SharedPtr<IPAddress>, int32_t, AsyncCallback, System::SharedPtr<Object>) method

发起异步连接操作。

System::SharedPtr<IAsyncResult> System::Net::Sockets::Socket::BeginConnect(System::SharedPtr<IPAddress> address, int32_t port, AsyncCallback requestCallback, System::SharedPtr<Object> state)
参数类型描述
地址System::SharedPtr<IPAddress>远程主机 IP 地址。
portint32_t远程主机的端口号。
requestCallbackAsyncCallback当操作完成时将被调用的回调。
stateSystem::SharedPtr<Object>用户提供的数据,用于唯一标识每个异步连接操作。

ReturnValue

表示已发起的异步连接操作的 IAsyncResult 对象。

另见