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);
        }
Beispiel #3
0
 public override Task Start(TestContext ctx, IConnectionInstrumentation instrumentation, CancellationToken cancellationToken)
 {
     return(FinishedTask);
 }
Beispiel #4
0
 public abstract Task Start(TestContext ctx, IConnectionInstrumentation instrumentation, CancellationToken cancellationToken);