Exemplo n.º 1
0
 void on_message(proton::delivery &d, proton::message &msg) override {
     if (msg.id().get<uint64_t>() < received)
         return; // ignore duplicate
     if (expected == 0 || received < expected) {
         std::cout << msg.body() << std::endl;
         received++;
     }
     if (received == expected) {
         d.receiver().close();
         d.connection().close();
     }
 }
Exemplo n.º 2
0
 void on_message(proton::delivery &d, proton::message &msg) override {
     received_content_ = proton::get<proton::binary>(msg.body());
     received_bytes_ += received_content_.size();
     if (received_ < total_) {
         received_++;
     }
     d.settle();
     if (received_ == total_) {
         d.receiver().close();
         d.connection().close();
     }
 }
Exemplo n.º 3
0
    void on_message(proton::delivery &d, proton::message &msg) override {
        if (proton::coerce<uint64_t>(msg.id()) < received) {
            return; // Ignore duplicate
        }

        if (expected == 0 || received < expected) {
            std::cout << msg.body() << std::endl;
            received++;
        }

        if (received == expected) {
            d.receiver().close();
            d.connection().close();

            if (!!acceptor) acceptor.close();
        }
    }
Exemplo n.º 4
0
 // A message is received.
 void on_message(proton::delivery &d, proton::message &m) override {
     std::string qname = d.receiver().target().address();
     queues_.get(qname)->push(m);
 }