Exemplo n.º 1
0
        public static void Start()
        {
            int i = 0;

            try
            {
                AuthSocket nonstatic = new AuthSocket();
                nonstatic.RealmSocket.Bind(EndPoint);
                nonstatic.RealmSocket.Listen(4);
                while (true)
                {
                    Thread.Sleep(10);
                    if (i == 0)
                    {
                        ColoredConsole.ConsoleWriteWhiteWithOne("AuthServer listening on port {0}", World.RealmserverPort);
                        ColoredConsole.ConsoleWriteGreenWithOut("Waiting for incoming connections...");
                        i += 1;
                    }
                    nonstatic.RealmSocket.BeginAccept(new AsyncCallback(nonstatic.Listen_Callback), null);
                }
            }
            catch (Exception se)
            {
                Console.WriteLine(se.ToString());
            }
        }