I am implementing Qpid proton client with C++.
Qpid version is 0.12.2.
I run default container:
proton::container(myHandler).run();
MyHandler is like this:
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;
}
Every thing works fine! It connects, create sender, etc.
But, on_sendable
is called just once! Although I dont close it, it nevers return to call on_sendable
.
What could be the reason?
Thanks.
You might have found the answer to this question by yourself but from what I understand on_sendable will be called after you open a sender and then every time after you send a message over proton. If you never send messages then on_sendable will be called just once.