/// <summary> /// 协议解析处理 /// </summary> /// <param name="dates">协议数据</param> /// <param name="sessionID">连接SessionID</param> /// <returns>是否解析成功</returns> public bool Parse(RecvedProtocolDataInfo protoData) { m_protoData = protoData; if (InternalProtocolClientHelper.IntepretMessage(m_protoData.m_Datas, this)) { return(true); } if (InternalProtocolServerHelper.IntepretMessage(m_protoData.m_Datas, this)) { return(true); } return(false); }
/// <summary> /// 压入数据 /// </summary> /// <param name="protoData">协议数据</param> public void PushData(RecvedProtocolDataInfo protoData) { lock (m_cachePoolLock) { if (protoData.m_IsClientData == true) { ++m_curClientCacheItems; if (m_curClientCacheItems > m_maxClientCacheItems) { --m_curClientCacheItems; //协议丢弃提示 SvLogger.Error("Protocol Pool Is Full!!!"); return; } } m_cachePool.Enqueue(protoData); } }