Esempio n. 1
0
        static void Main(string[] args)
        {
            var chatServer = new ChatServer();

            chatServer.Start();
            Console.ReadLine();
        }
Esempio n. 2
0
 private void Btn_Start_Click(object sender, EventArgs e)
 {
     if (isConnect)
     {
         server.Stop();
         Btn_Start.Text = "Star";
     }
     else
     {
         server = new ChatServer(Combo_IP.Text, Txt_port.Text, this);
         server.Start();
         Btn_Start.Text = "Stop";
     }
     isConnect = !isConnect;
 }
Esempio n. 3
0
        static void Main(string[] args)
        {
            ChatServer server = new ChatServer("127.0.0.1", 12345);

            try
            {
                server.Start();
            }
            catch (Exception e)
            {
                Console.WriteLine("Unexpected Exception occured.");
                Console.WriteLine(e.ToString());
                Console.ReadKey();
            }
        }
Esempio n. 4
0
        public static void Main()
        {
            ChatServer server = new ChatServer();

            server.Start();
            string command;

            do
            {
                command = Console.ReadLine() ?? "";
                if (command.Equals("cls"))
                {
                    Console.Clear();
                }
            } while (!command.Equals("stop"));
            server.Close();
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            ChatServer server = new ChatServer();

            server.Start();
        }