Exemple #1
0
 public void Send(byte[] data, IPEndPoint ip)
 {
     if (LogEnable)
     {
         Debug.Log("向" + ip + "发送udp数据:" + data.Length);
     }
     while (data.Length > MAX)
     {
         byte[] d = new byte[MAX];
         Array.Copy(data, 0, d, 0, d.Length);
         udp.SendTo(d, ip);
         d = new byte[data.Length - d.Length];
         Array.Copy(data, MAX, d, 0, d.Length);
         data = d;
     }
     udp.SendTo(data, ip);
 }