GetAllReceivePack() public method

取出消息缓存中所有接收到的消息队列,并清空消息缓存
public GetAllReceivePack ( List packList ) : void
packList List
return void
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);
                }
            }
        }
Beispiel #2
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);
                }
            }
        }