示例#1
0
        public static byte[] c2sSyn()
        {
            byte[] nByte = StructConverter.Pack(0);

            int len = HELLO_STR.Length + nByte.Length;

            byte[] bytes = new byte[len];

            int offset = 0;
            Buffer.BlockCopy(nByte, 0, bytes, 0, nByte.Length);
            offset = offset + nByte.Length;

            byte[] cBytes = System.Text.Encoding.ASCII.GetBytes(HELLO_STR);
            Buffer.BlockCopy(cBytes, 0, bytes, offset, cBytes.Length);

            return bytes;
        }
示例#2
0
 public static byte[] c2sAck(int fd, int token)
 {
     return StructConverter.Pack(fd, C2S_ACK, token);
 }