mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-01-06 00:31:14 +01:00
Suppport for raw arrays in send_multipart
This commit is contained in:
parent
5cc7793ef5
commit
d4d3ce3e90
@ -96,8 +96,10 @@ template<class Range,
|
|||||||
detail::send_result_t send_multipart(socket_ref s, Range&& msgs,
|
detail::send_result_t send_multipart(socket_ref s, Range&& msgs,
|
||||||
send_flags flags = send_flags::none)
|
send_flags flags = send_flags::none)
|
||||||
{
|
{
|
||||||
auto it = msgs.begin();
|
using std::begin;
|
||||||
const auto end_it = msgs.end();
|
using std::end;
|
||||||
|
auto it = begin(msgs);
|
||||||
|
const auto end_it = end(msgs);
|
||||||
size_t msg_count = 0;
|
size_t msg_count = 0;
|
||||||
while (it != end_it)
|
while (it != end_it)
|
||||||
{
|
{
|
||||||
@ -106,7 +108,7 @@ detail::send_result_t send_multipart(socket_ref s, Range&& msgs,
|
|||||||
if (!s.send(*it, msg_flags))
|
if (!s.send(*it, msg_flags))
|
||||||
{
|
{
|
||||||
// zmq ensures atomic delivery of messages
|
// zmq ensures atomic delivery of messages
|
||||||
assert(it == msgs.begin());
|
assert(it == begin(msgs));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
++msg_count;
|
++msg_count;
|
||||||
|
Loading…
Reference in New Issue
Block a user