Base class for Static Virtual Channel
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="context"></param>
        public Rdpbcgr_DVCServerTransport(RdpbcgrServerSessionContext context)
        {
            this.sessionContext = context;

            if (sessionContext.SVCManager == null)
            {
                throw new NotSupportedException("Cannot get SVC from RDPBCGR connection for RDPEDYC, this transport must be created after RDPBCGR connection established.");
            }

            channel = sessionContext.SVCManager.GetChannelByName(StaticVirtualChannelName.RDPEDYC);
            if (channel == null)
            {
                throw new NotSupportedException("Cannot get SVC from RDPBCGR connection for RDPEDYC, the static virtual channel is not created.");
            }

            channel.Received += ReceivedBytes;

            if (!sessionContext.SVCManager.IsRunning)
            {
                // Better start the SVC manager here, so as to make sure the first packet of RDPEDYC can be processed
                // it is not same restrict as client, since the first packet is sent by server
                sessionContext.SVCManager.Start();
            }

            decoder = new ServerDecodingPduBuilder();
            pduBuilder = new PduBuilder();
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="context"></param>
        public Rdpbcgr_DVCClientTransport(RdpbcgrClientContext context)
        {
            this.context = context;

            if (context.SVCManager == null)
            {
                throw new NotSupportedException("Cannot get SVC from RDPBCGR connection for RDPEDYC, this transport must be created after RDPBCGR connection established.");
            }

            channel = context.SVCManager.GetChannelByName(StaticVirtualChannelName.RDPEDYC);
            if (channel == null)
            {
                throw new NotSupportedException("Cannot get SVC from RDPBCGR connection for RDPEDYC, the static virtual channel is not created.");
            }

            channel.Received += ReceivedBytes;
            if (!context.SVCManager.IsRunning)
            {
                // Must start the SVC manager here, so as to make sure the first packet of RDPEDYC can be processed
                context.SVCManager.Start();
            }

            decoder = new ClientDecodingPduBuilder();
            pduBuilder = new PduBuilder();
        }
示例#3
0
        /// <summary>
        /// Split and compress the complete virtual channel data into chunk data.
        /// </summary>
        /// <param name="completeData">The compete virtual channel data. This argument can be null.</param>
        /// <returns>The splitted chunk data.</returns>
        internal ChannelChunk[] SplitToChunks(UInt16 channelId, byte[] completeData)
        {
            if (!channelDicById.ContainsKey(channelId))
            {
                throw new ArgumentException("The channel id does not exist!");
            }
            StaticVirtualChannel channel = channelDicById[channelId];

            return(channel.SplitToChunks(completeData));
        }