Repository: qpid-proton Updated Branches: refs/heads/master adb17eb72 -> ed23beaf2 PROTON-1480: Fix hello_world_direct example not to call listener::stop more than once Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/ed23beaf Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/ed23beaf Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/ed23beaf Branch: refs/heads/master Commit: ed23beaf21e44e85f430b6811484f13e2b88ca7d Parents: adb17eb Author: Andrew Stitcher Authored: Tue May 16 15:45:19 2017 -0400 Committer: Andrew Stitcher Committed: Tue May 16 17:42:51 2017 -0400 ---------------------------------------------------------------------- examples/cpp/helloworld_direct.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ed23beaf/examples/cpp/helloworld_direct.cpp ---------------------------------------------------------------------- diff --git a/examples/cpp/helloworld_direct.cpp b/examples/cpp/helloworld_direct.cpp index b3a1af8..9331587 100644 --- a/examples/cpp/helloworld_direct.cpp +++ b/examples/cpp/helloworld_direct.cpp @@ -46,23 +46,23 @@ class hello_world_direct : public proton::messaging_handler { c.open_sender(url); } + // Send one message and close sender void on_sendable(proton::sender &s) OVERRIDE { proton::message m("Hello World!"); s.send(m); s.close(); } + // Receive one message and stop listener void on_message(proton::delivery &, proton::message &m) OVERRIDE { std::cout << m.body() << std::endl; + listener.stop(); } + // After receiving acknowledgement close connection void on_tracker_accept(proton::tracker &t) OVERRIDE { t.connection().close(); } - - void on_connection_close(proton::connection&) OVERRIDE { - listener.stop(); - } }; int main(int argc, char **argv) { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org