MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / send_multipart

Function send_multipart

3rdparty/cppzmq/zmq_addon.hpp:227–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225#endif
226 >
227send_result_t
228send_multipart(socket_ref s, Range &&msgs, send_flags flags = send_flags::none)
229{
230 using std::begin;
231 using std::end;
232 auto it = begin(msgs);
233 const auto end_it = end(msgs);
234 size_t msg_count = 0;
235 while (it != end_it) {
236 const auto next = std::next(it);
237 const auto msg_flags =
238 flags | (next == end_it ? send_flags::none : send_flags::sndmore);
239 if (!s.send(*it, msg_flags)) {
240 // zmq ensures atomic delivery of messages
241 assert(it == begin(msgs));
242 return {};
243 }
244 ++msg_count;
245 it = next;
246 }
247 return msg_count;
248}
249
250/* Encode a multipart message.
251

Callers

nothing calls this directly

Calls 3

sendMethod · 0.80
beginFunction · 0.70
endFunction · 0.70

Tested by

no test coverage detected