public MainWindow() { InitializeComponent(); service = new Service(this); clientList = new CDictionary<NetworkClient, UserData>(); listener = new TcpListener(IPAddress.Any, 8080);//0xBEAF); physics = new PhysicsManager(this); }
static Service server;// = new Service(); static void Main(string[] args) { server = new Service(); if (args.Count() == 1) BuildServer(args[0]); else if (args.Count() == 2) BuildServer(args[0], args[1]); else BuildServer(); Console.WriteLine("Для завершення роботи серверу, введiть (q)."); while (Console.ReadLine() != "q") { serviceHost.Close(); } }
static void Main(string[] args) { var port = 12345; if (args.Length == 1) Int32.TryParse(args[0], out port); var service = new Service(port); service.Start(); Console.WriteLine("Press ENTER to stop"); if (Console.Read() == (int) ConsoleKey.Enter) service.Stop(); }
static void Main(string[] args) { if (!Environment.UserInteractive) { // running as service using (var service = new Service()) ServiceBase.Run(service); } else { // Running from the console Start(args); Console.WriteLine("Starting RabbitMQ queue processor"); Console.ReadLine(); Stop(); } }