internal VirtualConnection(Scheduler Scheduler, VirtualServer cServer) { Srv = cServer; zSched = Scheduler; zNNTP = new cNNTP(cServer, this); zConnection = new ConnectionTask(); vIdle = new ManualResetEventSlim(); vCancel = new CancellationTokenSource(); }
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(); } }