Beispiel #1
0
        //-------------------------------------------------------------------------
        private void __Update(CNetTCPSocketConnect connect)
        {
            if (null == connect)
            {
                return;
            }

            int nID = SNetCommon.NUNE_VALUE;
            // 进入连接器 状态回调
            ENUM_SOCKET_STATE sState = connect.Update(out nID);

            if (nID == m_ReadyToConnectSID)
            {
                m_currentConnectState = sState;
                m_currentConnectedSID = m_ReadyToConnectSID;
            }

            // 消息取出来 外部进行消息分发
            if (connect.IsConnect())
            {
                List <SocketNetPacket> packList = new List <SocketNetPacket>();
                connect.GetAllReceivePack(packList);
                foreach (SocketNetPacket tempack in packList)
                {
                    NetMessageRecieveHandle.GetInstance().OnRecvMessage(tempack);
                }
            }
        }
 //-------------------------------------------------------------------------
 public static NetMessageRecieveHandle GetInstance()
 {
     if (p_Instance == null)
     {
         p_Instance = new NetMessageRecieveHandle();
     }
     return p_Instance;
 }
 //-------------------------------------------------------------------------
 static public NetMessageRecieveHandle GetInstance()
 {
     if (p_Instance == null)
     {
         p_Instance = new NetMessageRecieveHandle();
     }
     return(p_Instance);
 }