/// <summary>
        /// 异步接收回调函数
        /// </summary>
        /// <param name="i_IAsyncResult"></param>
        public void EndReceiveFromCallback(IAsyncResult i_IAsyncResult)
        {
            m_iProcessCounter++;
            Console.WriteLine("第{0}个请求连接!", m_iProcessCounter);
            Class_State n_State          = i_IAsyncResult.AsyncState as Class_State;
            Socket      n_Socket_Receive = n_State.p_Socket_Receive;

            /*Socket n_Socket_Send = n_State.p_Socket_Send*/

            try
            {
                //完成接收
                int n_ibtReadLength = n_Socket_Receive.EndReceiveFrom(i_IAsyncResult, ref n_State.p_EndPoint);

                //显示客户端地址和端口
                Console.WriteLine("客户端终结点:{0}", n_State.p_EndPoint.ToString());
                //显示接收信息
                Console.WriteLine("接收数据字节数:{0}", n_ibtReadLength);
                string n_sMessage = Encoding.Default.GetString(n_State.p_Buffer, 0, n_ibtReadLength);
                Console.WriteLine("来着客户端信息:{0}", n_sMessage);

                //n_Socket_Receive.Disconnect(true);

                Socket n_Socket_Send = new Socket(
                    AddressFamily.InterNetwork,
                    SocketType.Dgram,
                    ProtocolType.Udp);
                //得到客户机IP
                EndPoint n_EndPoint_Send = (EndPoint)(new IPEndPoint(IPAddress.Any, 0));
                //EndPoint n_EndPoint_Send = (EndPoint)(new IPEndPoint(IPAddress.Parse("192.168.1.172"), 8003));
                n_Socket_Send.Bind(n_EndPoint_Send);
                n_Socket_Send.ReceiveTimeout    = 60000;
                n_Socket_Send.SendTimeout       = 60000;
                n_Socket_Send.ReceiveBufferSize = 1024 * 10000;
                n_Socket_Send.SendBufferSize    = 1024 * 10000;
                n_Socket_Send.Ttl = 255;
                //n_Socket_Send.NoDelay = true;
                n_Socket_Send.MulticastLoopback = true;


                //发送结束字符
                byte[] n_btData = { 0x5A, 0x5A };
                //向客户端发送信息
                SendMeaage(n_Socket_Send, n_State.p_EndPoint, n_btData);
                Class_Para n_Class_Para = new Class_Para();
                n_Class_Para.p_EndPoint    = n_State.p_EndPoint;
                n_Class_Para.p_Socket_Send = n_Socket_Send;// n_State.p_Socket_Send;
                m_iStartCounter++;
                Console.WriteLine("第{0}个请求处理开始!", m_iStartCounter);
                //进入线程
                Thread n_Thread_Run = new Thread(m_Process);
                n_Thread_Run.Start(n_Class_Para);
                //回收
                GC.Collect();
                ////
                //m_Process(n_Class_Para);

                ////方法2 线程池
                //ThreadPool.QueueUserWorkItem(new WaitCallback(m_Process), n_Class_Para);
            }
            catch (Exception e)
            {
                Console.WriteLine("发生异常!异常信息:");
                Console.WriteLine(e.Message);
            }
            finally
            {
                ////非常重要:继续异步接收
                //socket.BeginReceiveFrom(
                //    state.Buffer, 0, state.Buffer.Length,
                //    SocketFlags.None,
                //    ref state.RemoteEP,
                //    EndReceiveFromCallback,
                //    state);

                //事件状态终止
                m_ManualResetEvent_ReceiveDone.Set();
            }
        }
        /// <summary>
        ///
        /// </summary>
        public void SocketBeginReceive()
        {
            Socket n_Socket_Receive = null;

            try
            {
                //线程池设置
                ThreadPool.SetMinThreads(2, 2);
                //线程池设置
                ThreadPool.SetMaxThreads(500, 500);
                //发送
                n_Socket_Receive = new Socket(
                    AddressFamily.InterNetwork,
                    SocketType.Dgram,
                    ProtocolType.Udp);
                //EndPoint n_EndPoint_Receive = new IPEndPoint(IPAddress.Parse("192.168.1.172"), 8002);
                EndPoint n_EndPoint_Receive = new IPEndPoint(IPAddress.Any, 8002);
                n_Socket_Receive.Bind(n_EndPoint_Receive);
                n_Socket_Receive.ReceiveTimeout    = 60000;
                n_Socket_Receive.SendTimeout       = 60000;
                n_Socket_Receive.ReceiveBufferSize = 1024 * 10000;
                n_Socket_Receive.SendBufferSize    = 1024 * 10000;
                //n_Socket_Receive.NoDelay = true;
                n_Socket_Receive.MulticastLoopback = true;
                n_Socket_Receive.Ttl = 255;
                ////启动异步接收
                //Class_State n_Class_State = new Class_State(n_Socket_Receive);
                //Socket n_Socket_Send = new Socket(
                //      AddressFamily.InterNetwork,
                //      SocketType.Dgram,
                //      ProtocolType.Udp);
                ////得到客户机IP
                ////EndPoint n_EndPoint_Send = (EndPoint)(new IPEndPoint(IPAddress.Any, 0));
                //EndPoint n_EndPoint_Send = (EndPoint)(new IPEndPoint(IPAddress.Any, 8003));
                //n_Socket_Send.Bind(n_EndPoint_Send);
                //进入循环
                while (true)
                {
                    m_ManualResetEvent_ReceiveDone = new ManualResetEvent(false);
                    //启动异步接收
                    Class_State n_Class_State = new Class_State(n_Socket_Receive);
                    //调用接收回调函数
                    IAsyncResult n_IAsyncResult = n_Socket_Receive.BeginReceiveFrom(
                        n_Class_State.p_Buffer,
                        0,
                        n_Class_State.p_Buffer.Length,
                        SocketFlags.None,
                        ref n_Class_State.p_EndPoint,
                        EndReceiveFromCallback,
                        n_Class_State);
                    //阻止
                    bool n_bFlag = m_ManualResetEvent_ReceiveDone.WaitOne();
                    //回收
                    GC.Collect();
                }
            }
            finally
            {
                try
                {
                    if (n_Socket_Receive != null)
                    {
                        n_Socket_Receive.Close();
                    }
                }
                catch
                { }
            }
        }