本文整理汇总了C#中Microsoft.Protocols.TestTools.StackSdk.PduMarshaler.ReadToEnd方法的典型用法代码示例。如果您正苦于以下问题:C# PduMarshaler.ReadToEnd方法的具体用法?C# PduMarshaler.ReadToEnd怎么用?C# PduMarshaler.ReadToEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Protocols.TestTools.StackSdk.PduMarshaler
的用法示例。
在下文中一共展示了PduMarshaler.ReadToEnd方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Decode
/// <summary>
/// Decode this PDU from the PduMarshaler.
/// </summary>
/// <param name="marshaler">This is used to encode the fields of this PDU.</param>
public override bool Decode(PduMarshaler marshaler)
{
bool fDecoded = base.Decode(marshaler);
if (fDecoded)
{
return (this.Header.PacketType == PacketTypeValues.TSMM_PACKET_TYPE_CLIENT_NOTIFICATION || this.Header.PacketType == PacketTypeValues.TSMM_PACKET_TYPE_PRESENTATION_RESPONSE);
}
else
{
marshaler.Reset();
throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
}
}
示例2: Decode
/// <summary>
/// Decode this PDU to the PduMarshaler.
/// </summary>
/// <param name="marshaler">This is used to Decode the fields of this PDU.</param>
/// <returns></returns>
public override bool Decode(PduMarshaler marshaler)
{
try
{
base.Decode(marshaler);
MaxNumMonitors = marshaler.ReadUInt32();
MaxMonitorAreaFactorA = marshaler.ReadUInt32();
MaxMonitorAreaFactorB = marshaler.ReadUInt32();
return true;
}
catch
{
marshaler.Reset();
throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
}
}
示例3: Decode
/// <summary>
/// Decode this PDU from the PduMarshaler.
/// </summary>
/// <param name="marshaler">This is used to decode the fields of this PDU.</param>
public override bool Decode(PduMarshaler marshaler)
{
try
{
if (!base.Decode(marshaler)) return false;
this.quantIdxY = marshaler.ReadByte();
this.quantIdxCb = marshaler.ReadByte();
this.quantIdxCr = marshaler.ReadByte();
this.xIdx = marshaler.ReadUInt16();
this.yIdx = marshaler.ReadUInt16();
this.progressiveQuality = marshaler.ReadByte();
this.decodedLen += 8;
this.ySrlLen = marshaler.ReadUInt16();
this.yRawLen = marshaler.ReadUInt16();
this.cbSrlLen = marshaler.ReadUInt16();
this.cbRawLen = marshaler.ReadUInt16();
this.crSrlLen = marshaler.ReadUInt16();
this.crRawLen = marshaler.ReadUInt16();
this.decodedLen += 12;
this.ySrlData = marshaler.ReadBytes((int)this.ySrlLen);
this.decodedLen += this.ySrlLen;
this.yRawData = marshaler.ReadBytes((int)this.yRawLen);
this.decodedLen += this.yRawLen;
this.cbSrlData = marshaler.ReadBytes((int)this.cbSrlLen);
this.decodedLen += this.cbSrlLen;
this.cbRawData = marshaler.ReadBytes((int)this.cbRawLen);
this.decodedLen += this.cbRawLen;
this.crSrlData = marshaler.ReadBytes((int)this.crSrlLen);
this.decodedLen += this.crSrlLen;
this.crRawData = marshaler.ReadBytes((int)this.crRawLen);
this.decodedLen += this.crRawLen;
return true;
}
catch
{
marshaler.Reset();
throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
}
}
示例4: Decode
/// <summary>
/// Decode this PDU from the PduMarshaler.
/// </summary>
/// <param name="marshaler">This is used to decode the fields of this PDU.</param>
public override bool Decode(PduMarshaler marshaler)
{
try
{
base.Decode(marshaler);
this.surfaceIdSrc = marshaler.ReadUInt16();
pduLen += 2;
this.surfaceIdDest = marshaler.ReadUInt16();
pduLen += 2;
this.rectSrc.left = marshaler.ReadUInt16();
pduLen += 2;
this.rectSrc.top = marshaler.ReadUInt16();
pduLen += 2;
this.rectSrc.right = marshaler.ReadUInt16();
pduLen += 2;
this.rectSrc.bottom = marshaler.ReadUInt16();
pduLen += 2;
this.destPtsCount = marshaler.ReadUInt16();
pduLen += 2;
for (ushort i = 0; i < this.destPtsCount; i++)
{
RDPGFX_POINT16 destPoint;
destPoint.x = marshaler.ReadUInt16();
destPoint.y = marshaler.ReadUInt16();
destPtsList.Add(destPoint);
pduLen += (uint)Marshal.SizeOf(destPoint);
}
return true;
}
catch
{
marshaler.Reset();
throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd());
}
}
示例5: Decode
public override bool Decode(PduMarshaler marshaler)
{
try
{
fecHeader.snSourceAck = marshaler.ReadUInt32();
fecHeader.uReceiveWindowSize = marshaler.ReadUInt16();
fecHeader.uFlags = (RDPUDP_FLAG)marshaler.ReadUInt16();
if (fecHeader.uFlags.HasFlag(RDPUDP_FLAG.RDPUDP_FLAG_SYN))
{
RDPUDP_SYNDATA_PAYLOAD synData = new RDPUDP_SYNDATA_PAYLOAD();
synData.snInitialSequenceNumber = marshaler.ReadUInt32();
synData.uUpStreamMtu = marshaler.ReadUInt16();
synData.uDownStreamMtu = marshaler.ReadUInt16();
// This datagram MUST be zero-padded to increase the size of this datagram to 1232 bytes.
if (fecHeader.uFlags.HasFlag(RDPUDP_FLAG.RDPUDP_FLAG_CORRELATION_ID))
{
RDPUDP_CORRELATION_ID_PAYLOAD correlationId = new RDPUDP_CORRELATION_ID_PAYLOAD();
correlationId.uCorrelationId = marshaler.ReadBytes(16);
this.CorrelationId = correlationId;
correlationId.uReserved = marshaler.ReadBytes(16);
}
this.padding = marshaler.ReadToEnd();
this.SynData = synData;
return true;
}
if (fecHeader.uFlags.HasFlag(RDPUDP_FLAG.RDPUDP_FLAG_ACK))
{
// ACK.
RDPUDP_ACK_VECTOR_HEADER ackVector = new RDPUDP_ACK_VECTOR_HEADER();
ackVector.uAckVectorSize = marshaler.ReadUInt16();
ackVector.AckVectorElement = new AckVector[ackVector.uAckVectorSize];
List<byte> ackVecElementList = new List<byte>(marshaler.ReadBytes(ackVector.AckVectorElement.Length));
ackVecElementList.Reverse();
for (int i = 0; i < ackVector.AckVectorElement.Length; i++)
{
byte vecByte = ackVecElementList[i];
ackVector.AckVectorElement[i].Length = (byte)(0x3F & vecByte);
ackVector.AckVectorElement[i].State = (VECTOR_ELEMENT_STATE)(vecByte >> 6);
}
this.ackVectorHeader = ackVector;
// Padding (variable): A variable-sized array, of length zero or more,
// such that this structure ends on a DWORD ([MS-DTYP] section 2.2.9) boundary.
int padLen = 4 - (2 + ackVector.AckVectorElement.Length) % 4;
if (padLen > 0 && padLen != 4)
{
this.padding = marshaler.ReadBytes(padLen);
}
// Ack of Acks.
if (fecHeader.uFlags.HasFlag(RDPUDP_FLAG.RDPUDP_FLAG_ACK_OF_ACKS))
{
RDPUDP_ACK_OF_ACKVECTOR_HEADER aoaHeader = new RDPUDP_ACK_OF_ACKVECTOR_HEADER();
aoaHeader.snAckOfAcksSeqNum = marshaler.ReadUInt32();
this.ackOfAckVector = aoaHeader;
}
}
if (fecHeader.uFlags.HasFlag(RDPUDP_FLAG.RDPUDP_FLAG_DATA))
{
if (!fecHeader.uFlags.HasFlag(RDPUDP_FLAG.RDPUDP_FLAG_FEC))
{
// Source Data.
RDPUDP_SOURCE_PAYLOAD_HEADER srcHeader = new RDPUDP_SOURCE_PAYLOAD_HEADER();
srcHeader.snCoded = marshaler.ReadUInt32();
srcHeader.snSourceStart = marshaler.ReadUInt32();
this.sourceHeader = srcHeader;
}
else
{
// FEC Data.
RDPUDP_FEC_PAYLOAD_HEADER fecDataHeader = new RDPUDP_FEC_PAYLOAD_HEADER();
fecDataHeader.snCoded = marshaler.ReadUInt32();
fecDataHeader.snSourceStart = marshaler.ReadUInt32();
fecDataHeader.uRange = marshaler.ReadByte();
fecDataHeader.uFecIndex = marshaler.ReadByte();
fecDataHeader.uPadding = marshaler.ReadUInt16();
this.fecPayloadHeader = fecDataHeader;
}
this.payload = marshaler.ReadToEnd();
}
return true;
}
catch
{
return false;
}
}
示例6: Decode
/// <summary>
/// Decode this PDU from the PduMarshaler.
/// </summary>
/// <param name="marshaler">This is used to decode the fields of this PDU.</param>
public override bool Decode(PduMarshaler marshaler)
{
try
{
Data = marshaler.ReadToEnd();
}
catch (Exception)
{
Data = null;
return false;
}
return true;
}