Example #1
0
        public bool SendPb(ProtoBuf.IExtensible proto)
        {
            ByteBuffer buff = new ByteBuffer();

            byte[] contents = ProtoUtil.Serialize(proto);

            buff.WriteShort((ushort)(contents.Length + 2));
            buff.WriteShort((ushort)ProtoUtil.GetProtoType(proto));
            buff.WriteBytes(contents);

            this.SendBytes(buff.ToBytes());
            return(true);
        }