How to receive UDP packets from any ip and any port?
问题 I wanted to use C#'s UdpClient to listen to any incomming UDP packets. I want to receive packets from any IP and any port. I tried the following: UdpClient udpClient = new UdpClient(0); IPEndPoint ep = new IPEndPoint(IPAddress.Any, 0); byte[] data = udpClient.Receive(ref ep); but without success. Does anyone know whats wrong? Thanks in advance! 回答1: RECEIVE on any port? That's insane. You would be flooded with messages from other applications (try TcpView for an idea of how many messages get