/// <summary> /// Initialize adapter. /// </summary> /// <param name="testSite">The test site instance associated with the current adapter.</param> public override void Initialize(ITestSite testSite) { base.Initialize(ReqConfigurableSite.GetReqConfigurableSite(testSite)); PccrtpBothRoleCapture.Initialize(testSite); this.Site.DefaultProtocolDocShortName = "MS-PCCRTP"; this.sutOsVersion = (OSVersion)Enum.Parse( typeof(OSVersion), this.Site.Properties["Environment.DistributedSUT.OSVersion"].ToString(), true); this.isIpv4 = bool.Parse(Site.Properties["PCCRTP.Protocol.Address.isIPv4"]); this.listenPort = int.Parse(Site.Properties["Environment.ContentServer.HTTP.Port"]); if (this.isIpv4) { this.pccrtpServerStack = new PccrtpServer(this.listenPort, IPAddressType.IPv4, new Logger(testSite)); } else { this.pccrtpServerStack = new PccrtpServer(this.listenPort, IPAddressType.IPv6, new Logger(testSite)); } this.pccrtpServerStack.StartServer(); }
/// <summary> /// Dispose(bool disposing) executes in two distinct scenarios. /// If disposing equals true, the method has been called directly /// or indirectly by a user's code. Managed and unmanaged resources /// can be disposed. /// </summary> /// <param name="disposing"> /// If disposing equals false, the method has been called by the /// runtime from inside the finalizer and you should not reference /// other objects. Only unmanaged resources can be disposed. /// </param> protected override void Dispose(bool disposing) { if (this.pccrtpServerStack != null) { this.pccrtpServerStack.Dispose(); } base.Dispose(disposing); this.pccrtpServerStack = null; }