private void buttonConnect_Click(object sender, EventArgs e) { if (textBoxIP.Text.Length > 1 && textBoxPort.Text.Length > 1) { serverMain = new NcsMain(textBoxIP.Text, textBoxPort.Text, this); } else { MessageBox.Show("IP 와 Port 를 확인하여 주십시오"); } }
static void Main(string[] args) { ServerConfig mConfig = new ServerConfig() { Port = 65535, Ip = "Any", MaxConnectionNumber = 5000, Mode = SocketMode.Tcp, Name = "NcsMain" }; NcsMain ncsServer = new NcsMain(mConfig, ServerStarted.func, ServerNewSessionConnected.func, ServerSessionClosed.func, ServerNewRequestReceived.func); KeyWaiting.func(); }
static void Main(string[] args) { NcsTemplateBuffer.SetTempBuffer(); server = new NcsMain <NewUser>(new ServerConfig() { Port = 65535, Ip = "Any", MaxConnectionNumber = 5000, Mode = SocketMode.Tcp, Name = "NcsMain", }); while (Console.ReadLine() != "q") { } }