你好:
请问第二个IP的端口也是54464吗?据你的代码来看你的UDP类只接收54464端口发送过来的数据。如果你把端口号改为0,就可以接受任何端口了。
最好将本地监听的端口和远程的客户端端口区分开来,你的代码里面本地监听的端口是54464:
this.endpoint = new IPEndPoint(IPAddress.Any, 54464);
this.client = new UdpClient(endpoint);
然后接收的远程的端口也是同样的IPEndPoint:
buffer = state.client.EndReceive(result, ref state.endpoint);
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.