This builder is used to decode all PDU types possibly received by the server role.
Inheritance: PduBuilder
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="connectedRdpServer"></param>
        /// <param name="context"></param>
        /// <param name="transportType"></param>
        public Rdpemt_DVCServerTransport(RdpbcgrServer connectedRdpServer, RdpbcgrServerSessionContext context, DynamicVC_TransportType transportType)
        {
            this.serverSessionContext = context;
            this.rdpbcgrServer        = connectedRdpServer;
            this.transportProtocol    = Multitransport_Protocol_value.INITITATE_REQUEST_PROTOCOL_UDPFECR;
            if (transportType == DynamicVC_TransportType.RDP_UDP_Lossy)
            {
                this.transportProtocol = Multitransport_Protocol_value.INITITATE_REQUEST_PROTOCOL_UDPFECL;
            }

            if (!serverSessionContext.IsClientMultitransportChannelDataRecieved)
            {
                throw new NotSupportedException("This RDP connection doesn't support multiple transport!");
            }

            try
            {
                EstablishTransportConnection();
            }
            catch (Exception)
            {
                // Ensure resource can be released properly if exception occurred in Constructor
                Dispose();
                // Not suppress the exception, transfer the error to test result.
                throw;
            }

            decoder    = new ServerDecodingPduBuilder();
            pduBuilder = new PduBuilder();
        }
        /// <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_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();
        }
示例#4
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="connectedRdpServer"></param>
        /// <param name="context"></param>
        /// <param name="transportType"></param>
        public Rdpemt_DVCServerTransport(RdpbcgrServer connectedRdpServer, RdpbcgrServerSessionContext context, DynamicVC_TransportType transportType)
        {
            this.serverSessionContext = context;
            this.rdpbcgrServer        = connectedRdpServer;
            this.transportProtocol    = Multitransport_Protocol_value.INITITATE_REQUEST_PROTOCOL_UDPFECR;
            if (transportType == DynamicVC_TransportType.RDP_UDP_Lossy)
            {
                this.transportProtocol = Multitransport_Protocol_value.INITITATE_REQUEST_PROTOCOL_UDPFECL;
            }

            if (!serverSessionContext.IsClientMultitransportChannelDataRecieved)
            {
                throw new NotSupportedException("This RDP connection doesn't support multiple transport!");
            }

            EstablishTransportConnection();

            decoder    = new ServerDecodingPduBuilder();
            pduBuilder = new PduBuilder();
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="connectedRdpServer"></param>
        /// <param name="context"></param>
        /// <param name="transportType"></param>
        public Rdpemt_DVCServerTransport(RdpbcgrServer connectedRdpServer, RdpbcgrServerSessionContext context, DynamicVC_TransportType transportType)
        {
            this.serverSessionContext = context;
            this.rdpbcgrServer = connectedRdpServer;
            this.transportProtocol = Multitransport_Protocol_value.INITITATE_REQUEST_PROTOCOL_UDPFECR;
            if (transportType == DynamicVC_TransportType.RDP_UDP_Lossy)
            {
                this.transportProtocol = Multitransport_Protocol_value.INITITATE_REQUEST_PROTOCOL_UDPFECL;
            }

            if (!serverSessionContext.IsClientMultitransportChannelDataRecieved)
            {
                throw new NotSupportedException("This RDP connection doesn't support multiple transport!");
            }

            EstablishTransportConnection();

            decoder = new ServerDecodingPduBuilder();
            pduBuilder = new PduBuilder();
        }