C# UDP Socket: Get receiver address
问题 I have an asynchronous UDP server class with a socket bound on IPAddress.Any, and I'd like to know which IPAddress the received packet was sent to (...or received on). It seems that I can't just use the Socket.LocalEndPoint property, as it always returns 0.0.0.0 (which makes sense as it's bound to that...). Here are the interesting parts of the code I'm currently using: private Socket udpSock; private byte[] buffer; public void Starter(){ //Setup the socket and message buffer udpSock = new