/// <summary> /// /// </summary> /// <returns></returns> public long GetPacketLength() { long iReturn = 0; if (EventPacketLength != null) { PacketLengthInfoEventArgs packetLengthInfoEventArgs = new PacketLengthInfoEventArgs(m_Data, m_Size, 0); EventPacketLength(this, packetLengthInfoEventArgs); iReturn = packetLengthInfoEventArgs.PacketLength; } return(iReturn); }
/// <summary> /// 给出数据包的长度 /// </summary> /// <returns></returns> public long GetPacketLength() { long iReturn = 0; m_LockBuffer.Enter(); { EventHandler <PacketLengthInfoEventArgs> tempEvent = s_ThreadEventPacketLength; if (tempEvent != null) { PacketLengthInfoEventArgs packetLengthInfoEventArgs = new PacketLengthInfoEventArgs(m_Buffer, m_Size, m_Head); tempEvent(this, packetLengthInfoEventArgs); iReturn = packetLengthInfoEventArgs.PacketLength; } } m_LockBuffer.Exit(); return(iReturn); }