Пример #1
0
 public void sendMSG(byte[] bytes)
 {
     if (!socket.Connected)
     {
         Debug.Log("bread connect");
         socket.Close();
     }
     try
     {
         short  length  = (short)bytes.Length;
         byte[] byteLen = ByteUtil.short2ByteArray(length);
         Array.Reverse(byteLen);
         byte[] newByte = ByteUtil.ArrayAdd(byteLen, bytes);
         socket.Send(newByte);
     }catch (Exception e)
     {
         Debug.Log(e.ToString());
     }
 }