| 88 | } |
| 89 | |
| 90 | void send(proton::sender& s) { |
| 91 | // Only send with credit and only allow one outstanding message |
| 92 | while (s.credit() && sent < received+1) { |
| 93 | std::map<std::string, int> m; |
| 94 | m["sequence"] = sent + 1; |
| 95 | |
| 96 | proton::message msg; |
| 97 | msg.id(sent + 1); |
| 98 | msg.body(m); |
| 99 | |
| 100 | std::cout << "Sending: " << sent+1 << std::endl; |
| 101 | s.send(msg); |
| 102 | sent++; |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | void on_sender_open(proton::sender & s) override { |
| 107 | sender = s; |