Exemplo n.º 1
0
 void on_accepted(proton::event &e) {
     confirmed_++;
     e.delivery().settle();
     if (confirmed_ == total_) {
         std::cout << "all messages confirmed" << std::endl;
         if (!replying_)
             e.connection().close();
     }
 }
Exemplo n.º 2
0
 void on_message(proton::event &e) {
     proton::message &msg = e.message();
     msg.body().decode() >> received_content_;
     received_bytes_ += received_content_.size();
     if (received_ < total_) {
         received_++;
     }
     e.delivery().settle();
     if (received_ == total_) {
         e.receiver().close();
         e.connection().close();
     }
 }