System::Net::Sockets::Socket::Connect 方法

Socket::Connect(String, int32_t) method

建立到指定远程端点的连接。

void System::Net::Sockets::Socket::Connect(String host, int32_t port)
参数类型描述
hostString远程主机名。
portint32_t远程主机的端口号。

另见

Socket::Connect(System::ArrayPtr<System::SharedPtr<IPAddress>>, int32_t) method

建立到指定远程端点的连接。

void System::Net::Sockets::Socket::Connect(System::ArrayPtr<System::SharedPtr<IPAddress>> addresses, int32_t port)
参数类型描述
addressesSystem::ArrayPtr<System::SharedPtr<IPAddress>>远程主机的 IP 地址。
portint32_t远程主机的端口号。

另见

Socket::Connect(System::SharedPtr<EndPoint>) method

建立到指定远程端点的连接。

void System::Net::Sockets::Socket::Connect(System::SharedPtr<EndPoint> remoteEP)
参数类型描述
remoteEPSystem::SharedPtr<EndPoint>远程端点。

另见

Socket::Connect(System::SharedPtr<IPAddress>, int32_t) method

建立到指定远程端点的连接。

void System::Net::Sockets::Socket::Connect(System::SharedPtr<IPAddress> address, int32_t port)
参数类型描述
地址System::SharedPtr<IPAddress>远程主机 IP 地址。
portint32_t远程主机的端口号。

另见