protected override void Destroy() { var disposedEx = new ObjectDisposedException(GetType().Name); if (Interlocked.CompareExchange(ref destroyed, disposedEx, null) != null) { return; } try { if (sslStream != null) { sslStream.Dispose(); } } catch { ; } finally { sslStream = null; } innerSocket = accepted = socket = null; innerStream = null; instrumentation = null; }
public sealed override Task Start(TestContext ctx, IConnectionInstrumentation instrumentation, CancellationToken cancellationToken) { if (destroyed != null) { throw destroyed; } if (Interlocked.CompareExchange(ref started, 1, 0) != 0) { throw new InvalidOperationException("Duplicated call to Start()."); } this.instrumentation = instrumentation; if (IsServer) { StartServer(ctx, cancellationToken); } else { StartClient(ctx, cancellationToken); } return(FinishedTask); }
public override Task Start(TestContext ctx, IConnectionInstrumentation instrumentation, CancellationToken cancellationToken) { return(FinishedTask); }
public abstract Task Start(TestContext ctx, IConnectionInstrumentation instrumentation, CancellationToken cancellationToken);