Ejemplo n.º 1
0
        //@Brief Obtiene la información de la actualización periódica
        //@Return dc_InfoUpdatePeriodicTime Información de la actualización periódica
        public dc_InfoUpdatePeriodicTime GetUpdatePeriodicTime()
        {
            dc_InfoUpdatePeriodicTime infoUpdatePeriodicTime = new dc_InfoUpdatePeriodicTime();

            infoUpdatePeriodicTime.available = false;
            infoUpdatePeriodicTime.modeDaily = true;
            infoUpdatePeriodicTime.hour      = (byte)0;
            infoUpdatePeriodicTime.minute    = (byte)0;
            infoUpdatePeriodicTime.weekday   = (byte)1;

            try
            {
                m_mutexHostControllerEndpoints.WaitOne();
                foreach (EndpointAddress ep in m_hostControllerEndpoints)
                {
                    BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None);
                    JBCHostControllerServiceClient serviceClient = new JBCHostControllerServiceClient(binding, ep);

                    serviceClient.Open();
                    infoUpdatePeriodicTime = serviceClient.GetUpdatePeriodicTime();
                    serviceClient.Close();
                }
            }
            catch (Exception ex)
            {
                LoggerModule.logger.Error(System.Reflection.MethodInfo.GetCurrentMethod().Name + ". Error: " + ex.Message);
            }
            finally
            {
                m_mutexHostControllerEndpoints.ReleaseMutex();
            }

            return(infoUpdatePeriodicTime);
        }