示例#1
0
        //Точка входа в программу
        static void Main(string[] args)
        {
            //Создаем ядро работы чата
            var core = new ClientCore();

            //Запускаем его работу
            core.Work();
            //Если работа завершена - выводим про это сообщение
            System.Console.WriteLine("The END");
        }
示例#2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            int port;

            try
            {
                IPAddress.Parse(tbIPAddress.Text);
            }
            catch
            {
                lMessage.Content = "IP Address is not correct!";
                return;
            }
            try
            {
                port = Int32.Parse(tbPort.Text);
                if (port < 0 || port > 65535)
                {
                    throw new Exception();
                }
            }
            catch
            {
                lMessage.Content = "Port is incorrect";
                return;
            }
            if (ClientCore.Connect(tbIPAddress.Text, port))
            {
                new wFileManager().Show();
                Close();
            }
            else
            {
                lMessage.Content = "Cannot connect";
            }
        }
示例#3
0
 void Awake()
 {
     client = MMOManager.Instance.clientCore;
 }
示例#4
0
文件: ClientForm.cs 项目: Ikthios/P2P
        private void startInternalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                // Internal check
                DisplayConnection = ("Starting internal server.");
                Debug.WriteLine("Starting internal server.");

                // Create and start threads
                ClientCore core = new ClientCore();
                Thread clientThread = new Thread(core.StartClientThread);
                clientThread.Start();

                downMonBtn.Text = "Accepting Requests";
                downMonBtn.BackColor = Color.Green;
            }
            catch (Exception error)
            {
                errorTextBox.AppendText(error.ToString());
                DisplayError(error.ToString());
                downMonBtn.Text = "Peer Connection Failed";
                downMonBtn.BackColor = Color.Red;
            }
        }