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.
我想在 C# 中创建一个客户端服务器 UDP 套接字。我通过单个请求响应成功发送和接收。
但我有一个问题。当我同时发送例如 5 个请求时。每个请求的响应时间不同。
我如何理解每个响应是针对哪个请求的?
var _connection = new UdpClient( port-to-listen-at ); IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0); byte[] data = _connection.Receive(ref sender);
当 Receive() 返回 'sender' 时,它包含 sender-info