public override void Stop(Exception ex) { if (LocalSession != null) { LocalSession.HandleSessionTrouble(ex); } base.Stop(ex); }
protected override void OnCompletion() { // Failure. if (Status == WorkerStatus.Cancelled || Status == WorkerStatus.Failed || m_session.Status != VncSessionStatus.Tunnel) { // Kill the tunnel. if (InternalAnpTunnel != null) { InternalAnpTunnel.Terminate(); } // Notify the session. if (m_session.Status == VncSessionStatus.Tunnel) { Debug.Assert(Status != WorkerStatus.Cancelled); m_session.HandleSessionTrouble(FailException); } } // Success. else { // Transfer ownership of the tunnel. m_session.Tunnel = InternalAnpTunnel; InternalAnpTunnel = null; // Handle the next step. m_session.HandleNextSessionStep(); } }