예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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);
        }