UdpClient UDPserver = new UdpClient(123);
    IPEndPoint IP = null;
    try
    {
        while (true)
        {
           UDPserver.Receive(ref IP);
            bytes = Encoding.UTF8.GetBytes("您好!");
            UDPserver.Send(bytes, bytes.Length,IP);
        }
    }
    catch (Exception e)
    { 
    } 
    finally //确保线程退出时关闭!!
    {
        UDPserver.Close();
    }