public void send(byte command, byte[] buffer)
 {
     byte[] t = new byte[buffer.Length + 1];
     t[0] = command;
     Array.Copy(buffer, 0, t, 1, buffer.Length);
     channel.Send(t);
 }
Esempio n. 2
0
 public void sendtoloadbalanceserver(byte command, byte[] buffer)
 {
     byte[] t = new byte[buffer.Length + 1];
     t[0] = command;
     Array.Copy(buffer, 0, t, 1, buffer.Length);
     channel_loadbalance.Send(t);
 }
Esempio n. 3
0
        public void Begin()
        {
            th = new Timerhandler((string s) => {
#if RTT
                string str = TimeHelper.Now().ToString();
                ////////////////////////////////////////////////////////////
                //ASCIIEncoding asen = new ASCIIEncoding();
                UTF8Encoding utf8 = new UTF8Encoding();
                byte[] buffer     = utf8.GetBytes(str);
                channel.Send(ref buffer);
                //Console.WriteLine(s);
                //Logger.log(ts);
#else
#endif
            }, ts, 1000, true);
            // Global.GetComponent<Timer>().Add(th);
        }