【问题标题】:qpid proton on_sendable is called just onceqpid proton on_sendable 只调用一次
【发布时间】:2017-04-20 05:07:43
【问题描述】:

我正在用 C++ 实现 Qpid 质子客户端。

Qpid 版本为 0.12.2。

我运行默认容器:

proton::container(myHandler).run();

MyHandler 是这样的:

void MyHandler::on_start(proton::event& e) {
proton::connection conn = e.container().connect(url);
_senderEvent            = conn.open_sender(EVENT_RECEPTION);
}

void MyHandler::on_message(proton::event &e) {
}

void MyHandler::on_link_open(proton::event &e) {
    std::cout << "LINK OPEN " << std::endl;
}

void MyHandler::on_connection_open(proton::event &e) {
}

void MyHandler::on_sendable(proton::event &e) {
    std::cout << "on sendable! " << std::endl;
}

一切正常!它连接、创建发件人等。

但是,on_sendable 只被调用一次!虽然我没有关闭它,但它永远不会返回调用on_sendable

可能是什么原因?

谢谢。

【问题讨论】:

    标签: c++ qpid


    【解决方案1】:

    您可能已经自己找到了这个问题的答案,但据我了解,on_sendable 将在您打开发件人后调用,然后每次通过质子发送消息后调用。如果你从不发送消息,那么 on_sendable 只会被调用一次。

    【讨论】:

      猜你喜欢
      • 2018-07-12
      • 2016-08-06
      • 2016-01-13
      • 2015-03-04
      • 2014-09-07
      • 2017-07-01
      • 2017-10-17
      • 2016-05-19
      • 2015-09-02
      相关资源
      最近更新 更多