// Send n messages void send_thread(sender& s, int n) { auto id = std::this_thread::get_id(); for (int i = 0; i < n; ++i) { std::ostringstream ss; ss << std::this_thread::get_id() << "-" << i; s.send(proton::message(ss.str())); OUT(std::cout << id << " sent \"" << ss.str() << '"' << std::endl); } OUT(std::cout << id << " sent " << n << std::endl); }
void apply(sender& s) { if (s.uninitialized()) { if (delivery_mode.set) set_delivery_mode(s, delivery_mode.value); if (handler.set && handler.value) set_handler(s, *handler.value); if (auto_settle.set) get_context(s).auto_settle = auto_settle.value; if (source.set) { proton::source local_s(make_wrapper<proton::source>(pn_link_source(unwrap(s)))); source.value.apply(local_s); } if (target.set) { proton::target local_t(make_wrapper<proton::target>(pn_link_target(unwrap(s)))); target.value.apply(local_t); } } }
void messaging_handler::on_sender_error(sender &l) { on_error(l.error()); }
void handler::on_sender_error(sender &l) { on_error(l.error()); }