Ejemplo n.º 1
0
        static void Start()
        {
            TCPServer server = new TCPServer();

            new Thread(() =>
            {
                StartConsole();
            }).Start();

            while (true)
            {
                Channel <string> ch = server.Accept();
                chs.Add(ch);
                new Thread(() =>
                {
                    Console.WriteLine("new connection");
                    try
                    {
                        ConnectEcho(ch);
                        return;
                    }
                    catch (Exception)
                    {
                        return;
                    }
                }).Start();
            }
        }