Ejemplo n.º 1
0
 static void Main(string[] args)
 {
     UdpAsyncServer server = new UdpAsyncServer(8878, 10, 4 * 1024);
     server.OnReceived += ReceiveCompleted;
     server.Start();
     Console.ReadLine();
 }
Ejemplo n.º 2
0
 static void Main(string[] args)
 {
     UdpAsyncServer server = new UdpAsyncServer(8879, 10, 4 * 1024);
     server.OnReceived += ReceiveCompleted;
     server.Start();
     Console.ReadLine();
     while (true)
     {
         server.SendAsync(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 8878), new SendCommond() { CommondId = 11, Buffer = Encoding.UTF8.GetBytes("我爱我的祖国啊啊啊啊,测试测试") });
         Console.ReadLine();
     }
 }