Example #1
0
        private async Task PingAndCheckServer(ServerSettings serverSettings)
        {
            var proxy = new CoreServiceProxy();

            int apiComparison;

            try
            {
                apiComparison = await proxy.Ping(Constants.RestApiVersion).ConfigureAwait(false);
            }
            catch (ArgusTVException ex)
            {
                throw new ArgusTVNotFoundException(ex, "'{0}:{1}' not found, is the service running?", serverSettings.ServerName, serverSettings.Port);
            }
            if (apiComparison < 0)
            {
                throw new ArgusTVException("ARGUS TV Recorder on server is more recent, upgrade client");
            }
            else if (apiComparison > 0)
            {
                throw new ArgusTVException("ARGUS TV Recorder on server is too old, upgrade server");
            }
            serverSettings.WakeOnLan.MacAddresses = String.Join(";", await proxy.GetMacAddresses().ConfigureAwait(false));
            serverSettings.WakeOnLan.IPAddress    = WakeOnLan.GetIPAddress(serverSettings.ServerName);
        }
Example #2
0
        private void Ping_FTR_Job(string _forTheRecordServerName, int _forTheRecordPort, out int result)
        {
            result = -3;



            try
            {
                if (!Proxies.IsInitialized) // ServiceChannelFactories.IsInitialized)
                {
                    InitializeServiceChannelFactories(_forTheRecordServerName, _forTheRecordPort);
                    FTR2LO_Log.FTR2LO_log.do_log(_modulename, (int)FTR2LO_log.LogLevel.DEBUG, "InitializeServiceChannelFactories on " + _forTheRecordServerName + ":" + _forTheRecordPort);
                }
                //using (ArgusTV.ServiceAgents.CoreServiceAgent iftrs = new ArgusTV.ServiceAgents.CoreServiceAgent())
                ArgusTV.ServiceProxy.CoreServiceProxy iftrs = null; // new ArgusTV.ServiceProxy.CoreServiceProxy();
                {
                    result = iftrs.Ping(Constants.CurrentApiVersion);
                }
            }

            catch (EndpointNotFoundException)
            {
                //MessageBox.Show("EnpointNotFoundEx: " + ex.ToString());
            }
            catch (Exception)
            {
                //MessageBox.Show("Ex: " + ex.ToString());
            }

            //return result;
        }
Example #3
0
 private static void ResetProxies()
 {
     _configurationServiceProxy = null;
     _controlServiceProxy       = null;
     _coreServiceProxy          = null;
     _guideServiceProxy         = null;
     _logServiceProxy           = null;
     _schedulerServiceProxy     = null;
 }
Example #4
0
        private async Task PingAndCheckServer(ServerSettings serverSettings)
        {
            var proxy = new CoreServiceProxy();

            int apiComparison;
            try
            {
                apiComparison = await proxy.Ping(Constants.RestApiVersion).ConfigureAwait(false);
            }
            catch (ArgusTVException ex)
            {
                throw new ArgusTVNotFoundException(ex, "'{0}:{1}' not found, is the service running?", serverSettings.ServerName, serverSettings.Port);
            }
            if (apiComparison < 0)
            {
                throw new ArgusTVException("ARGUS TV Recorder on server is more recent, upgrade client");
            }
            else if (apiComparison > 0)
            {
                throw new ArgusTVException("ARGUS TV Recorder on server is too old, upgrade server");
            }
            serverSettings.WakeOnLan.MacAddresses = String.Join(";", await proxy.GetMacAddresses().ConfigureAwait(false));
            serverSettings.WakeOnLan.IPAddress = WakeOnLan.GetIPAddress(serverSettings.ServerName);
        }
Example #5
0
 private static void ResetProxies()
 {
     _configurationServiceProxy = null;
     _controlServiceProxy = null;
     _coreServiceProxy = null;
     _guideServiceProxy = null;
     _logServiceProxy = null;
     _schedulerServiceProxy = null;
 }