예제 #1
0
        /// <summary>
        /// Internal helper to execute the service in foreground mode.
        /// </summary>
        /// <param name="args"></param>
        private static void RunForeground(string[] args)
        {
            UDPServerService svc = new UDPServerService();

            svc.ForceStartCLI(args);

            Console.WriteLine(">>> Press Q to quit");

            while (Console.ReadKey().KeyChar.ToString().ToUpper() != "Q")
            {
                ;
            }

            svc.ForceStopCLI();
            Environment.Exit(0);
        }
예제 #2
0
 /**
  * Methods
  */
 /// <summary>
 /// Initializes a new instance of the <see cref="UDPServerService"/> class.
 /// </summary>
 public UDPServerService()
 {
     instance    = this;
     ServiceName = _ServiceName;
 }