IEnumerator SendCo()
 {
     while (true)
     {
         string msg = "hello " + index;
         if (tcpNetComp.State == "connected")
         {
             tcpNetComp.SendString(msg);
         }
         if (kcpNetComp.State == "connected")
         {
             kcpNetComp.SendString(msg);
         }
         if (udpNetComp.State == "connected")
         {
             udpNetComp.SendString(msg);
         }
         index++;
         yield return(new WaitForSeconds(sendInterval));
     }
 }
Exemple #2
0
 public void Test()
 {
     udpNetComp.SendString("hello " + index++);
 }