public void sendunreliable(ref byte[] buffer)
        {
            List <byte> tempcontent = new List <byte>();

            tempcontent.AddRange(header);
            tempcontent.Add(UNRELIABLESIGN); //mean unreliable
            tempcontent.Add(NORMALDATASIGN); //mean this is normal data
            int headersize = tempcontent.Count;

            byte[] temparray = new byte[headersize + 2 + buffer.Length];                                            // 2 mean 2 byte valide data length
            Array.ConstrainedCopy(tempcontent.ToArray(), 0, temparray, 0, headersize);                              //load header
            Array.ConstrainedCopy(ByteArraytoUint16.Serialize((UInt16)buffer.Length), 0, temparray, headersize, 2); // load 2 byte valide data length
            Array.ConstrainedCopy(buffer, 0, temparray, headersize + 2, buffer.Length);
            mudpclient.Send(temparray);
        }
        public void sendreliable(ref byte[] buffer)
        {
            List <byte> tempcontent = new List <byte>();

            tempcontent.AddRange(header);
            tempcontent.Add(RELIABLESIGN);     //mean reliable
            tempcontent.Add(reliabledataid++); //mean reliable message id
            int headersize = tempcontent.Count;

            byte[] temparray = new byte[headersize + 2 + buffer.Length];                                            // 2 mean 2 byte valide data length
            Array.ConstrainedCopy(tempcontent.ToArray(), 0, temparray, 0, headersize);                              //load header
            Array.ConstrainedCopy(ByteArraytoUint16.Serialize((UInt16)buffer.Length), 0, temparray, headersize, 2); // load 2 byte valide data length
            Array.ConstrainedCopy(buffer, 0, temparray, headersize + 2, buffer.Length);
            lock (QueuedreliabledataLock)
            {
                Queuedreliabledata.Enqueue(temparray);
            }
        }