Пример #1
0
        static void Main(string[] args)
        {
            string host          = "0.0.0.0";
            int    port          = 7777;
            string connectionstr = "server=localhost;user=newuser1;database=test;port=3306;password=123456";

            DatabaseAPI.API.Init(connectionstr);
            TcpServer server = new TcpServer(host, port);

            server.AcceptConnectionEvent += AcceptConnectionConsole;
            server.AcceptConnectionEvent += AcceptConnectionFunc;
            server.StartListeningAsync();
            string message = "";

            while ((message = Console.In.ReadLine()) != null)
            {
            }
            server.StopListeningAsync();
        }