Ejemplo n.º 1
0
tracker sender::send(const message &message) {
    uint64_t id = ++tag_counter;
    pn_delivery_t *dlv =
        pn_delivery(pn_object(), pn_dtag(reinterpret_cast<const char*>(&id), sizeof(id)));
    std::vector<char> buf;
    message.encode(buf);
    assert(!buf.empty());
    pn_link_send(pn_object(), &buf[0], buf.size());
    pn_link_advance(pn_object());
    if (pn_link_snd_settle_mode(pn_object()) == PN_SND_SETTLED)
        pn_delivery_settle(dlv);
    if (!pn_link_credit(pn_object()))
        link_context::get(pn_object()).draining = false;
    return make_wrapper<tracker>(dlv);
}
Ejemplo n.º 2
0
link_options::sender_settle_mode link::sender_settle_mode() {
    return (link_options::sender_settle_mode) pn_link_snd_settle_mode(pn_object());
}
Ejemplo n.º 3
0
link::sender_settle_mode_t link::sender_settle_mode() {
    return (sender_settle_mode_t) pn_link_snd_settle_mode(pn_object());
}