System::Net::Sockets::UdpClient::Connect 方法

UdpClient::Connect(String, int32_t) method

在指定的主机上建立到指定端口的连接。

void System::Net::Sockets::UdpClient::Connect(String hostname, int32_t port)
参数类型描述
hostnameString您打算连接的远程 DNS 主机的名称。
portint32_t您打算通信的本地端口号。

另见

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

在指定端口上与位于指定地址的主机建立连接。

void System::Net::Sockets::UdpClient::Connect(System::SharedPtr<IPAddress> addr, int32_t port)
参数类型描述
addrSystem::SharedPtr<IPAddress>用于发送数据的远程主机的 IPAddress
portint32_t您打算通信的本地端口号。

另见

UdpClient::Connect(System::SharedPtr<IPEndPoint>) method

建立到远程端点的连接。

void System::Net::Sockets::UdpClient::Connect(System::SharedPtr<IPEndPoint> endPoint)
参数类型描述
endPointSystem::SharedPtr<IPEndPoint>您绑定 UDP 连接的端点。

另见