我正在尝试与本地端口50177的特定端点发送和接收数据。发送数据非常好,但当程序尝试接收数据时,它无法接收任何数据。当我使用Wireshark嗅探网络时,我看到服务器向我发送了数据。我知道我不能同时在一个端口上拥有2个UdpClient。
有人能帮助我吗?
UdpClient udpClient2 = new UdpClient(50177);
IPEndPoint Ip2 = new IPEndPoint(IPAddress.Parse("255.255.255.255"), 1005);
udpClient2.Send(peerto255, peerto255.Length, Ip2);
IPEndPoint Ip = new IPEndPoint(IPAddress.Parse("10.10.240.1"), 1005);
var dgram = udpClient2.Receive(ref Ip);
sendClient.Client.Bind(ep1);
应该改为sendClient.Client.Bind(ep2);
吗? - Alex Johnson