private void startBtn_Click(object sender, EventArgs e) { iocp.Start(1086); iocp.mainForm = this; startBtn.Enabled = false; stopBtn.Enabled = true; SetListBox("监听开启..."); }
static void Main(string[] args) { IPAddress ipAddress = IPAddress.Parse("0.0.0.0"); IPEndPoint localEndPoint = new IPEndPoint(ipAddress, 9000); IoServer iocp = new IoServer(1000, 10); iocp.Start(localEndPoint); Console.WriteLine("Press any key to terminate the server process...."); Console.ReadKey(); }