public UDPTest() { var svrPort = "127.0.0.1:7100"; var kcpSvr = KcpSvr.Start(svrPort); kcpSvr.OnKcpReceive += KcpSvr_OnKcpReceive; kcpSvr.OnNew += KcpSvr_OnNew; cl1 = KcpClient.Create(svrPort); cl1.OnKcpReceive += Kcpcl_OnKcpReceive; //cl1.Run(); //ClSendLoop(cl1); var t2 = ClSendLoop(cl1); Task.WaitAll(t2); }