0
我要检查使用UDPClient远程计算机的连接。听说如果发生故障它将返回一个icmp数据包。我们如何能够抓住它? 如何检查远程机器?如何检查远程UDP端口
UdpClient receivingUdpClient = new UdpClient();
receivingUdpClient.Connect(IPAddress.Parse("10.2.2.13"), 80);
Byte[] sendBytes = Encoding.ASCII.GetBytes("0");
Var b=receivingUdpClient.Send(sendBytes, sendBytes.Length);
这是一个类似的问题:http://stackoverflow.com/questions/23118113/c-sockets-send-udp-and-process-icmp-reply-from-router这样你就可以看到答案在那里。顺便说一句,ICMP可能会被对方压制,所以你可能根本没有收到它。先用Wireshark或类似软件进行检查。 –