示例#1
0
        private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e)
        {
            ServerOps ops = new ServerOps(this, ribbontxt_port.EditValue.ToString(), this);

            //ListEventViews.list.Clear(); //初始化计时器集合
            TimerViews.Clear();
            m_server.StartServer(ops);
        }
示例#2
0
 public bool Start_ConsoleServer()
 {
     if (!IsServerStarted)
     {
         string port;
         port = string.Format("{0:D3}", Settings.Default.PortServer);
         ServerOps ops = new ServerOps(this, port, this);
         m_server.StartServer(ops);
         IsServerStarted = true;
     }
     else
     {
         if (m_server.IsServerStarted)
         {
             m_server.StopServer();
             IsServerStarted = false;
             Program.AddLog("Server Stopped");
         }
     }
     return(IsServerStarted);
 }
示例#3
0
 private void btnConnect_Click(object sender, EventArgs e)
 {
     if (btnConnect.Text.Equals("Start"))
     {
         tbPort.Enabled  = false;
         btnConnect.Text = "Stop";
         string    port = tbPort.Text;
         ServerOps ops  = new ServerOps(this, port, this);
         //AddMsg("NoDelay: " + ops.NoDelay.ToString() + " MaxSocketCount: " + ops.MaxSocketCount.ToString());
         m_server.StartServer(ops);
         timer1.Enabled = true;
     }
     else
     {
         tbPort.Enabled  = true;
         btnConnect.Text = "Start";
         if (m_server.IsServerStarted)
         {
             m_server.StopServer();
             timer1.Enabled = false;
         }
     }
 }
示例#4
0
 private void btnConnect_Click(object sender, EventArgs e)
 {
     if (btnConnect.Text.Equals("Start"))
     {
         string port = tbPort.Text;
         tbPort.Enabled  = false;
         btnConnect.Text = "Stop";
         tbSend.Enabled  = true;
         btnSend.Enabled = true;
         ServerOps ops = new ServerOps(this, port, this);
         m_server.StartServer(ops);
     }
     else
     {
         tbPort.Enabled  = true;
         btnConnect.Text = "Start";
         tbSend.Enabled  = false;
         btnSend.Enabled = false;
         if (m_server.IsServerStarted)
         {
             m_server.StopServer();
         }
     }
 }
示例#5
0
 public Server(ServerOps ops = default)
 {
     this.ops = ops;
 }
示例#6
0
        private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e)
        {
            ServerOps ops = new ServerOps(this, ribbontxt_port.EditValue.ToString(), this);

            m_server.StartServer(ops);
        }
示例#7
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            ServerOps ops = new ServerOps(this, "12345", this);

            m_server.StartServer(ops);
        }