Example #1
0
        public void Shutdown()
        {
            _vncManager.StopVncServer();

            if (_worker != null)
            {
                _worker.CancelAsync();
            }

            if (_apiClient != null)
            {
                try
                {
                    _apiClient.Unregister(new UnregisterRequest
                    {
                        ComputerName = ConfigManager.Data.ComputerName,
                        GroupID      = ConfigManager.Data.GroupId
                    });
                } catch {}

                _apiClient.Close();
            }

            if (_relayManager != null)
            {
                _relayManager.Stop();
            }

            if (_externalEP != null)
            {
                UPnP.RemoveMapping(_externalEP.Port);
            }
        }
Example #2
0
        private void Window_Closed(object sender, EventArgs e)
        {
            if (worker != null)
            {
                worker.CancelAsync();
            }

            if (apiClient != null)
            {
                apiClient.Close();
            }
        }