qpid 质子 on_sendable 只被调用一次

qpid proton on_sendable is called just once

我正在用 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 只被调用了一次!虽然我没有关闭它,但它永远不会 return 调用 on_sendable

可能是什么原因?

谢谢。

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