UDP是无联结协议,客户端只需要将服务器的地址以及端口填写正确,对方一定收得到的。
就像你到邮局去寄信,你只要把收信人的地址写正确,我写不写你的地址,别人一定收得到,但是别人如果要回信(如果你没有正确的写好你的地址)那就是难了。

解决方案 »

  1.   

    概念要清楚:
    1,data is sent to your machine on a specific port,your udpclient can only receive from your machine on one port to which you bound your udpclient when you initialize it.
    2,udpclient.receive(ref IPEndPoint): after the receive method the IPEndPoint was changed to the endpoint of the sender, that is to specify the IPEndPoint is useless or meaningless;版主还我36分!!!