Пример #1
0
Файл: Vnc.cs Проект: tmbx/kwm-ng
        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();
            }
        }
Пример #2
0
Файл: Vnc.cs Проект: tmbx/kwm-ng
        protected override void OnTunnelConnected()
        {
            NegociateRole();
            NegociateSession();

            // Disconnect the tunnel. This will make it reconnect to the
            // local VNC process.
            InternalAnpTunnel.Disconnect();
        }