我正在尝试使用本地端口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);
Run Code Online (Sandbox Code Playgroud)