static void Main(string[] args) { Console.WriteLine("输入ip:"); string s = Console.ReadLine(); if (s == "") { s = "127.0.0.1"; } //Console.WriteLine("异步发送模式?(1:异步 其他:同步)"); //if(Console.ReadLine() == "1") { // UdpLibConfig.ServerSendAsync = true; //} Console.WriteLine("开始"); IRQLog.AppLog = new IRQLog(); IRQLog.AppLog.Start("output.csv"); KCPServer server = new KCPServer(s, 10001); server.NewClientSession += server_NewClientSession; server.CloseClientSession += server_CloseClientSession; server.RecvData += server_RecvData; for (int i = 1; i < 10000; i++) { server.AddClientKey((uint)i, i); } server.Start(); while (true) { server.Update(); } }
public void Update() { //Log.Info("111111"); server.Update(); }