From commits-return-39910-apmail-qpid-commits-archive=qpid.apache.org@qpid.apache.org Tue May 16 21:43:20 2017 Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6336419C3B for ; Tue, 16 May 2017 21:43:20 +0000 (UTC) Received: (qmail 24564 invoked by uid 500); 16 May 2017 21:43:20 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 24538 invoked by uid 500); 16 May 2017 21:43:20 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 24529 invoked by uid 99); 16 May 2017 21:43:20 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 May 2017 21:43:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3283CDFDD5; Tue, 16 May 2017 21:43:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: astitcher@apache.org To: commits@qpid.apache.org Message-Id: <59b31f0fcdc743fabd78171a32f2c9ed@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: qpid-proton git commit: PROTON-1480: Fix hello_world_direct example not to call listener::stop more than once Date: Tue, 16 May 2017 21:43:20 +0000 (UTC) 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