Пример #1
0
        public static void Main(string[] args)
        {
            // Setup the Viewer
            string host = "localhost"; //args[0].Trim();
            int    port = 6000;        //int.Parse(args[1].Trim());

            viewer = new TcpChatViewer(host, port);

            // Add a handler for a Ctrl-C press
            Console.CancelKeyPress += InterruptHandler;

            // Try to connect & view messages
            viewer.Connect();
            viewer.ListenForMessages();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("===Chat-Board===");
            Console.CancelKeyPress += (sender, e) =>
            {
                viewer.Disconnect();
                e.Cancel = true;
            };
            // setup the messenger
            string host = "localhost";
            int    port = 6000;

            viewer = new TcpChatViewer(host, port);

            viewer.Connect();
            viewer.ListenForMessages();
        }