65 const std::string &msg_name) {
66 bsize msg_len =
static_cast<bsize>(proto->ByteSizeLong());
67 char *tmp =
new char[msg_len]();
68 if (!proto->SerializeToArray(tmp,
static_cast<int>(msg_len))) {
73 bsize frame_index = 0;
74 uint32_t total_frames =
static_cast<uint32_t
>(msg_len /
FRAME_SIZE +
77 while (offset < msg_len) {
84 header.
SetMsgID(proto->header().sequence_num());
93 buf.buf_ =
new char[cpy_size + header_size];
94 buf.buf_len_ = cpy_size + header_size;
96 memcpy(buf.buf_ + header_size, tmp + frame_index *
FRAME_SIZE, cpy_size);
97 frames_.push_back(buf);