Inheritance: DynamicVCPDU
 /// <summary>
 /// Process DVC packet, but don't process data packet
 /// Data packet will be processed by corresponding Dynamic virtual channel
 /// </summary>
 /// <param name="pdu">DVC packet</param>
 /// <param name="transportType">Transport type</param>
 private void ProcessPacket(DynamicVCPDU pdu, DynamicVC_TransportType transportType)
 {
     if (pdu is DataDvcBasePdu)
     {
         DataDvcBasePdu dataPdu = pdu as DataDvcBasePdu;
         if (channelDicbyId.ContainsKey(dataPdu.ChannelId))
         {
             channelDicbyId[dataPdu.ChannelId].ProcessPacket(dataPdu);
         }
     }
     else
     {
         if (autoCreateChannel)
         {
             if (pdu is CreateReqDvcPdu)
             {
                 this.EstablishChannel(pdu as CreateReqDvcPdu, transportType);
                 return;
             }
             else if (pdu is CloseDvcPdu)
             {
                 this.CloseChannel(pdu as CloseDvcPdu);
                 return;
             }
         }
         lock (unprocessedDVCPacketBuffer)
         {
             unprocessedDVCPacketBuffer.Add(new UnprocessedDVCPDUInfo(pdu, transportType));
         }
     }
 }
        /// <summary>
        /// Process DVC Data
        /// </summary>
        /// <param name="pdu"></param>
        private void ProcessDataPdu(DataDvcBasePdu pdu)
        {
            if (pdu is DataFirstDvcPdu)
            {
                dataFragmentManager = new DataFragmentManager();
                DataFirstDvcPdu first = (DataFirstDvcPdu)pdu;
                dataFragmentManager.AddFirstData(first.Length, first.Data);
            }
            else if (pdu is DataDvcPdu)
            {
                if (dataFragmentManager == null)
                {
                    // Single data PDU which is not fragmented.
                    if (this.Received != null)
                    {
                        this.Received(pdu.Data, this.ChannelId);
                    }
                    return;
                }
                else
                {
                    // Received a fragment.
                    dataFragmentManager.AppendData(pdu.Data);
                }
            }

            if (dataFragmentManager.Completed)
            {
                if (this.Received != null)
                {
                    this.Received(dataFragmentManager.Data, this.ChannelId);
                }
                dataFragmentManager = null;
            }
        }
 /// <summary>
 /// Process DVC packet, only process Data on this channel
 /// </summary>
 /// <param name="pdu"></param>
 public void ProcessPacket(DataDvcBasePdu pdu)
 {
     if (pdu.ChannelId == this.channelId)
     {
         ProcessDataPdu(pdu as DataDvcBasePdu);
     }
 }
        /// <summary>
        /// Process DVC Data
        /// </summary>
        /// <param name="pdu"></param>
        private void ProcessDataPdu(DataDvcBasePdu pdu)
        {
            if (pdu is DataFirstDvcPdu)
            {
                dataFragmentManager = new DataFragmentManager();
                DataFirstDvcPdu first = (DataFirstDvcPdu)pdu;
                dataFragmentManager.AddFirstData(first.Length, first.Data);
            }
            else if (pdu is DataDvcPdu)
            {
                if (dataFragmentManager == null)
                {
                    // Single data PDU which is not fragmented.
                    if (this.Received != null)
                    {
                        this.Received(pdu.Data, this.ChannelId);
                    }
                    return;
                }
                else
                {
                    // Received a fragment.
                    dataFragmentManager.AppendData(pdu.Data);
                }
            }

            if (dataFragmentManager.Completed)
            {
                if (this.Received != null)
                {
                    this.Received(dataFragmentManager.Data, this.ChannelId);
                }
                dataFragmentManager = null;
            }
        }
 /// <summary>
 /// Process DVC packet, only process Data on this channel
 /// </summary>
 /// <param name="pdu"></param>
 public void ProcessPacket(DataDvcBasePdu pdu)
 {
     if (pdu.ChannelId == this.channelId)
     {
         ProcessDataPdu(pdu as DataDvcBasePdu);
     }
 }
        /// <summary>
        /// Process DVC Data
        /// </summary>
        /// <param name="pdu"></param>
        private void ProcessDataPdu(DataDvcBasePdu pdu)
        {
            if (pdu is DataFirstDvcPdu)
            {
                dataFragmentManager = new DataFragmentManager();
                DataFirstDvcPdu first = (DataFirstDvcPdu)pdu;
                dataFragmentManager.AddFirstData(first.Length, first.Data);
            }
            else if (pdu is DataDvcPdu)
            {
                if (dataFragmentManager == null)
                {
                    // Single data PDU which is not fragmented.
                    if (this.Received != null)
                    {
                        this.Received(pdu.Data, this.ChannelId);
                    }
                    return;
                }
                else
                {
                    // Received a fragment.
                    dataFragmentManager.AppendData(pdu.Data);
                }
            }
            else if (pdu is DataCompressedDvcPdu)
            {
                CompressFactory Compressor = new CompressFactory();
                if (dataFragmentManager == null)
                {
                    RDP_SEGMENTED_DATA segData = new RDP_SEGMENTED_DATA();
                    bool fResult = PduMarshaler.Unmarshal(pdu.Data, segData);
                    if (fResult)
                    {
                        if (segData.descriptor == DescriptorTypes.SINGLE)
                        {
                            byte[] rawData = Compressor.Decompress(segData.bulkData.data, segData.bulkData.header);
                            // Single data PDU which is not fragmented.
                            if (this.Received != null)
                            {
                                this.Received(rawData, this.ChannelId);
                            }
                            return;
                        }
                    }
                }
                else
                {
                    // Received a fragment.
                    dataFragmentManager.AppendData(pdu.Data);
                }
            }

            if (dataFragmentManager.Completed)
            {
                if (this.Received != null)
                {
                    this.Received(dataFragmentManager.Data, this.ChannelId);
                }
                dataFragmentManager = null;
            }
        }