System::Net::Sockets::UdpClient 类
UdpClient class
提供用户数据报协议(UDP)网络服务。此类的对象只能使用 System::MakeObject() 函数分配。切勿在栈上或使用 operator new 创建此类型的实例,因为这会导致运行时错误和/或断言故障。始终将此类包装到 System::SmartPtr 指针中,并使用该指针在函数中作为参数传递。
class UdpClient : public System::IDisposable
方法
| 方法 | 描述 |
|---|---|
| Close() | 关闭 UDP 连接。 |
| Connect(String, int32_t) | 在指定主机上建立到指定端口的连接。 |
| Connect(System::SharedPtr<IPAddress>, int32_t) | 在指定端口上与指定地址的主机建立连接。 |
| Connect(System::SharedPtr<IPEndPoint>) | 与远程端点建立连接。 |
| Dispose() override | 释放 UdpClient 使用的托管和非托管资源。 |
| get_Client() | RTTI 信息。 |
| Receive(System::SharedPtr<IPEndPoint>&) | 返回服务器发送的数据报。 |
| Send(System::ArrayPtr<uint8_t>, int32_t, System::SharedPtr<IPEndPoint>) | 向远程端点的主机发送 UDP 数据报。 |
| Send(System::ArrayPtr<uint8_t>, int32_t, String, int32_t) | 向指定远程主机的指定端口发送 UDP 数据报。 |
| Send(System::ArrayPtr<uint8_t>, int32_t) | 向远程主机发送 UDP 数据报。 |
| set_Client(System::SharedPtr<Socket>) | 用于提供底层网络套接字。 |
| UdpClient() | 初始化 UdpClient 类的新实例。 |
| UdpClient(AddressFamily) | 初始化 UdpClient 类的新实例。 |
| UdpClient(int32_t) | 初始化 UdpClient 类的新实例。 |
| UdpClient(int32_t, AddressFamily) | 初始化 UdpClient 类的新实例。 |
| UdpClient(System::SharedPtr<IPEndPoint>) | 初始化 UdpClient 类的新实例。参数 local EP 本地端点,您将其绑定到 UDP 连接。 |
| UdpClient(String, int32_t) | 创建 UdpClient 类的新实例,并连接到指定端口上的指定远程主机。 |
另见
- Class IDisposable
- Namespace System::Net::Sockets
- Library Aspose.Page for C++