/// <summary> /// Establish EMT connection and soft sync. /// </summary> private void StartSoftSyncConnection(TransportMode mode) { StartRDPConnection(false, true); this.TestSite.Log.Add(LogEntryKind.Comment, "Create a {0} UDP connection.", mode); this.EstablishUDPConnection(mode, waitTime); this.TestSite.Log.Add(LogEntryKind.Comment, "Create a {0} RDPEMT connection.", mode); this.EstablishRdpemtConnection(mode, waitTime, true); this.TestSite.Log.Add(LogEntryKind.Comment, "Expect for Client Initiate Multitransport PDU to indicate that the client was able to successfully complete the multitransport initiation request."); this.rdpbcgrAdapter.WaitForPacket <Client_Initiate_Multitransport_Response_PDU>(waitTime); // This response code MUST only be sent to a server that advertises the SOFTSYNC_TCP_TO_UDP (0x200) flag in the Server Multitransport Channel Data. // Indicates that the client was able to successfully complete the multitransport initiation request. if (requestIdList.Count == 1) { VerifyClientInitiateMultitransportResponsePDU(rdpbcgrAdapter.SessionContext.ClientInitiateMultitransportResponsePDU, requestIdList[0], HrResponse_Value.S_OK); } #region Start EDYC soft sync if (rdpedycServer == null) { rdpedycServer = new Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpedyc.RdpedycServer(this.rdpbcgrAdapter.ServerStack, this.rdpbcgrAdapter.SessionContext); } this.TestSite.Log.Add(LogEntryKind.Comment, "Start Dynamic VC Version Negotiation"); rdpedycServer.ExchangeCapabilities(waitTime); this.TestSite.Log.Add(LogEntryKind.Comment, "Start Soft-Sync"); rdpedycServer.SoftSyncNegotiate(waitTime); #endregion }
/// <summary> /// Create graphic dynamic virtual channel over UDP transport. /// </summary> private bool InitializeForSoftSync(DynamicVC_TransportType transportType = DynamicVC_TransportType.RDP_UDP_Reliable) { uint?channelId = null; if (!rdpedycServer.IsMultipleTransportCreated(transportType)) { rdpedycServer.CreateMultipleTransport(transportType); this.TestSite.Log.Add(LogEntryKind.Comment, "Expect for Client Initiate Multitransport PDU to indicate that the client was able to successfully complete the multitransport initiation request."); rdpbcgrAdapter.WaitForPacket <Client_Initiate_Multitransport_Response_PDU>(waitTime); TestSite.Assert.IsTrue( rdpbcgrAdapter.SessionContext.ClientInitiateMultitransportResponsePDU.hrResponse == HrResponse_Value.S_OK, "hrResponse field should be {0}", HrResponse_Value.S_OK); channelId = DynamicVirtualChannel.NewChannelId(); List <uint> list = new List <uint>(); list.Add((uint)channelId); Dictionary <TunnelType_Value, List <uint> > channelListDic = new Dictionary <TunnelType_Value, List <uint> >(); TunnelType_Value tunnelType = TunnelType_Value.TUNNELTYPE_UDPFECR; if (transportType == DynamicVC_TransportType.RDP_UDP_Lossy) { tunnelType = TunnelType_Value.TUNNELTYPE_UDPFECL; } channelListDic.Add(tunnelType, list); rdpedycServer.SoftSyncNegotiate(waitTime, channelListDic); } return(this.rdpegfxAdapter.CreateEGFXDvc(rdpedycServer, transportType, channelId)); }
/// <summary> /// Initialize this protocol with create control and data channels. /// </summary> /// <param name="rdpedycServer">RDPEDYC Server instance</param> /// <param name="transportType">selected transport type for created channels</param> /// <returns>true if client supports this protocol; otherwise, return false.</returns> public bool ProtocolInitialize(RdpedycServer rdpedycServer, DynamicVC_TransportType transportType = DynamicVC_TransportType.RDP_UDP_Reliable) { if (!rdpedycServer.IsMultipleTransportCreated(transportType)) { rdpedycServer.CreateMultipleTransport(transportType); } this.rdpefsServer = new RdpefsServer(rdpedycServer); bool success = false; // Create RDPEFS channel try { uint channelId = DynamicVirtualChannel.NewChannelId(); Dictionary <TunnelType_Value, List <uint> > channelListDic = new Dictionary <TunnelType_Value, List <uint> >(); List <uint> list = new List <uint>(); list.Add(channelId); channelListDic.Add(TunnelType_Value.TUNNELTYPE_UDPFECR, list); rdpedycServer.SoftSyncNegotiate(waitTime, channelListDic); success = rdpefsServer.CreateRdpefsDvc(waitTime, channelId); } catch (Exception e) { Site.Log.Add(LogEntryKind.Comment, "Exception occurred when creating RDPEFS channels: {1}", e.Message); } return(success); }