public RemoteOperater(UDP_PACKETS_CLIANT.UDP_PACKETS_CLIANT client, RemoteHostServer RHS, MainWindow parent)
 {
     m_SetIPEndPoint = new HashSet<System.Net.IPEndPoint>();
     this.RHS = RHS;
     this.mainwindow = parent;
     this.Client = client;
 }
        public RemoteHostServer(MainWindow mainwindow)
        {
            this.parent = mainwindow;

            try
            {
                this.Eventer = new TerminalConnectionSettings.CommandEventer();
                client = new UDP_PACKETS_CLIANT.UDP_PACKETS_CLIANT(myPort);
                this.remoteOperator = new RemoteOperater(client, this, mainwindow);
            }
            catch (Exception ex)
            {
                while (true)
                {
                    myDialog dialog = new myDialog(ex.Message);
                    if (dialog.ShowDialog() == true)
                    {
                        break;
                    }
                }
            }

            try
            {
                this.enc = new UDP_PACKETS_CODER.UDP_PACKETS_ENCODER();
                this.dec = new UDP_PACKETS_CODER.UDP_PACKETS_DECODER();
                this.LstPort = new List<int>();

            }
            catch (Exception ex)
            {
                while (true)
                {
                    myDialog dialog = new myDialog(ex.Message);
                    if (dialog.ShowDialog() == true)
                    {
                        break;
                    }
                }
            }
            try
            {
                #region create remotehost servers list and one remotehost server
                this.List_remotehost = new List<RemoteHost>();
                #endregion
                client.DataReceived += client_DataReceived;
            }
            catch (Exception ex)
            {
                while (true)
                {
                    myDialog dialog = new myDialog(ex.Message);
                    if (dialog.ShowDialog() == true)
                    {
                        break;
                    }
                }
            }
        }