Beispiel #1
0
        static void Main(string[] args)
        {
            MaintainLevels.Initialize();
            Console.WriteLine("Database up and maintenance daemon running");

            ServerSocket = new ServerSocket("any", SERVER_PORT, "\n", OnClientStateChange, OnClientRequest);
            Console.WriteLine("Server listening on port {0}", SERVER_PORT);



            using (var levelscontext = new LevelsContext())
            {
                levelscontext.Levels.Add(new LevelEntity());
                levelscontext.SaveChanges();
            }

            for (; ;)
            {
                Console.Write("> ");
                string message = Console.ReadLine();

                switch (message)
                {
                case "exit": Exit(); return;

                case "echo": Console.WriteLine("Hello"); break;
                }
            }
        }
Beispiel #2
0
 static void Exit()
 {
     ServerSocket.Close();
     MaintainLevels.Close();
 }