コード例 #1
0
 public bool HasCompletePDU()
 {
     if (m_bytesInBuffer >= 8)
     {
         if (!m_pduLength.HasValue)
         {
             m_pduLength = ISCSIPDU.GetPDULength(m_buffer, m_readOffset);
         }
         return(m_bytesInBuffer >= m_pduLength.Value);
     }
     return(false);
 }
コード例 #2
0
        /// <summary>
        /// HasCompletePDU must be called and return true before calling DequeuePDU
        /// </summary>
        /// <exception cref="System.IO.InvalidDataException"></exception>
        public ISCSIPDU DequeuePDU()
        {
            ISCSIPDU pdu;

            try
            {
                pdu = ISCSIPDU.GetPDU(m_buffer, m_readOffset);
            }
            catch (IndexOutOfRangeException ex)
            {
                throw new System.IO.InvalidDataException("Invalid PDU", ex);
            }
            RemovePDUBytes();
            return(pdu);
        }