private Tuple <PDUHeader, byte[]> ReadPDU(int frag_count) { byte[] buffer = _pipe.Read(_max_recv_fragment); RpcUtils.DumpBuffer(true, $"RPC Named Pipe Receive Buffer - Fragment {frag_count}", buffer); MemoryStream stm = new MemoryStream(buffer); BinaryReader reader = new BinaryReader(stm); PDUHeader header = PDUHeader.Read(reader); NdrUnmarshalBuffer.CheckDataRepresentation(header.DataRep); if (header.AuthLength != 0) { throw new NotSupportedException("Named pipe transport doesn't support authentication data."); } return(Tuple.Create(header, reader.ReadAllBytes(header.FragmentLength - PDUHeader.PDU_HEADER_SIZE))); }
/// <summary> /// Read the next fragment from the transport. /// </summary> /// <param name="max_recv_fragment">The maximum receive fragment length.</param> /// <returns>The read fragment.</returns> protected override byte[] ReadFragment(int max_recv_fragment) { return(_pipe.Read(max_recv_fragment)); }