Пример #1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            //ServiceBase[] ServicesToRun;
            //ServicesToRun = new ServiceBase[]
            //{
            //    new HostService()
            //};
            //ServiceBase.Run(ServicesToRun);

            ServiceHostEnhanced[] host;
            Channels            channels;
            List <Channel_Info> list;
            int i = 0;

            channels = new Channels();
            list     = channels.GetAllChannels();
            host     = new ServiceHostEnhanced[list.Count];
            foreach (Channel_Info channel in list)
            {
                host[i] = new ServiceHostEnhanced(channel);
                host[i].Open();
                i++;
                System.Threading.Thread.Sleep(10);
            }
            Console.WriteLine("Hosted...");
            while (true)
            {
                Thread.Sleep(10000);
            }
        }
Пример #2
0
 public void Start()
 {
     host = new ServiceHostEnhanced[channels.Channels.Count];
     for (int i = 0; i < channels.Channels.Count; i++)
     {
         host[i] = new ServiceHostEnhanced(channels.Channels[i]);
         host[i].Open();
         System.Threading.Thread.Sleep(10);
     }
 }
Пример #3
0
 protected override void OnStart(string[] args)
 {
     try
     {
         int i = 0;
         channels = new Channels();
         list     = channels.GetAllChannels();
         host     = new ServiceHostEnhanced[list.Count];
         foreach (Channel_Info channel in list)
         {
             host[i] = new ServiceHostEnhanced(channel);
             host[i].Open();
             i++;
             //System.Threading.Thread.Sleep(10);
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex);
     }
 }