示例#1
0
 private static void CreateService()
 {
     if (service != null)
     {
         service.Dispose();
     }
     service = IPBanService.CreateService <IPBanService>();
     service.Start();
 }
示例#2
0
        public static void MacMain(string[] args)
        {
            IPBanService service = IPBanService.CreateService();

            service.Start();
            IPBanLog.Warn("IPBan Mac Service Running, Press Ctrl-C to quit.");
            ManualResetEvent wait = new ManualResetEvent(false);

            wait.WaitOne();
        }
示例#3
0
 private static void CreateService(bool testing)
 {
     if (service != null)
     {
         service.Dispose();
     }
     service = IPBanService.CreateService(testing);
     service.Start();
     eventViewer = new IPBanWindowsEventViewer(service);
 }
示例#4
0
        public static void LinuxMain(string[] args)
        {
            bool         testing = false; // TODO: Change to true if we are running Linux tests
            IPBanService service = IPBanService.CreateService(testing);

            service.Start();
            IPBanLog.Write(LogLevel.Warning, "IPBan Linux Service Running, Press Ctrl-C to quit.");
            ManualResetEvent wait = new ManualResetEvent(false);

            wait.WaitOne();
        }
示例#5
0
        private static void CreateService(bool test)
        {
            if (service != null)
            {
                service.Dispose();
            }
            service = IPBanService.CreateService();
            if (test)
            {
                // TODO: Move to unit test project
                service.MultiThreaded     = false;
                service.ManualCycle       = true;
                service.SubmitIPAddresses = false;
                service.DB.Truncate(true);
            }
            service.Start();

            // attach Windows event viewer to the service
            eventViewer = new IPBanWindowsEventViewer(service);
        }