Ejemplo n.º 1
0
        internal VirtualConnection(Scheduler Scheduler, VirtualServer cServer)
        {
            Srv    = cServer;
            zSched = Scheduler;
            zNNTP  = new cNNTP(cServer, this);

            zConnection = new ConnectionTask();
            vIdle       = new ManualResetEventSlim();
            vCancel     = new CancellationTokenSource();
        }
Ejemplo n.º 2
0
        internal void Cancel()
        {
            Enabled = false;

            if (vCancel != null)
            {
                vCancel.Cancel(true);
            }

            if (zNNTP != null)
            {
                cNNTP KeepRef = zNNTP;
                zNNTP = null;
                KeepRef.Disconnect(998, "Cancelled", true);
                KeepRef = null;
            }

            zConnection = null;

            if (vIdle != null)
            {
                vIdle.Set();
            }
        }