我觉得这真的很奇怪。尝试使用UdpClient同步接收广播msg,但广播完成却没有返回。只有在随后的广播中,我才得到消息。我认为框架内的某处存在错误?
clientListener.BeginReceive(new AsyncCallback(RxBcastCallback), clientListener);
//this is passed as AsyncCall.AsyncState in the callback
......
UdpClient udpListener = (UdpClient)AsyncCall.AsyncState;
IPEndPoint remoteEndPt = new IPEndPoint(IPAddress.Any, 0);
byte[] inBuffer = udpListener.Receive(ref remoteEndPt);
//does not return until subsequent broadcast
谢谢,肯尼