public TDSHeader GetTDSHeader()
        {
            TDSHeader head = null;
            TDSReader r    = null;              // TDSReader does not need to be closed; GC is all it needs

            try
            {
                r    = new TDSReader(payload, 0); // header does not span packets, so we can read without aggregating
                head = TDSHeader.Read(r);
            }
            catch (Exception) { return(null); }  // null if error
            return(head);
        }
Beispiel #2
0
        public TDSHeader GetTDSHeader()
        {
            if (frames == null)
            {
                throw new InvalidOperationException("Packet must have at least one frame.");
            }
            TDSHeader head = null;
            TDSReader r    = null;              // TDSReader does not need to be closed; GC is all it needs

            try
            {
                r    = new TDSReader(((FrameData)(frames[0])).payload, 0); // header does not span packets, so we can read without aggregating
                head = TDSHeader.Read(r);
            }
            catch (Exception) { return(null); }  // null if error
            return(head);
        }