コード例 #1
0
ファイル: direct_recv.cpp プロジェクト: ajssmith/qpid-proton
 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();
     }
 }
コード例 #2
0
ファイル: direct_recv.cpp プロジェクト: ajssmith/qpid-proton
    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();
        }
    }