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); }
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); }
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; } } }
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(); } } }
public Server(ServerOps ops = default) { this.ops = ops; }
private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e) { ServerOps ops = new ServerOps(this, ribbontxt_port.EditValue.ToString(), this); m_server.StartServer(ops); }
private void simpleButton1_Click(object sender, EventArgs e) { ServerOps ops = new ServerOps(this, "12345", this); m_server.StartServer(ops); }