Closed caicaiking closed 1 year ago
Thos function is destructive so clear is a no-op it looks like. Copying messages is really the only way.
Thos function is destructive so clear is a no-op it looks like. Copying messages is really the only way.
So, Can I add this control parameter for send funciton?
What you really need to do is something like this
std::vector<zmq::const_buffer> bufs;
for (const auto& m : msgs)
bufs.emplace_back(m.data(), m.size());
while (not done)
{
auto ret = zmq::send_multipart(bufs);
// repeat send until something
}
Make a vector/array of buffers and use the send_multipart function (which will not modify the messages).
I need send message and recv message to do ACK, when I not recv the ack message I need to send it again. I don't want to use clone, because need time to copy.