Пример #1
0
    bool packedmessage_scan<MessageType>::pack(data_buffer& buffer)const
    {

        if(!msgs)
            return false;

        unsigned msg_size = msgs->ByteSize();
        buffer.resize(HEADER_SIZE + msg_size);
        //Included header file.
        encode_header(buffer, msg_size);

				LOG(INFO)<<" Pack message, msg_size : "<< 
					msg_size <<", buffer : "<<buffer.size();

        return msgs->SerializeToArray(&buffer[HEADER_SIZE], msg_size);

    }
Пример #2
0
 void reclaim_data_buffer(data_buffer& buffer)
 {
     cache_.add(buffer.size(), buffer);
     buffer.resize(0);
     buffer.reset();
 }