Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前在服务器和客户端上都使用 Socket 类来建立 udp 连接,现在它工作得很好,但我看到还有另一种使用 udp 套接字的方法,即 UdpClient 类。我的问题是我应该在 3d 多人游戏中使用什么?会影响性能吗?等等.....提前致谢!
UdpClient 是写在 Socket 类上的包装类。它是专门为使用套接字的 UDP 特性而编写的。您可以使用名为 Client 的属性访问 UdpClass 的套接字实例。像 TcpClient 也是写在用于 TCP 通信的 Socket 上。