You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ch...@apache.org on 2017/02/27 22:40:00 UTC

qpid-proton git commit: PROTON-1420: Cpp example direct_send receives instead. Fix it to send.

Repository: qpid-proton
Updated Branches:
  refs/heads/master 2dae68d6a -> 13e40e9e6


PROTON-1420: Cpp example direct_send receives instead. Fix it to send.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/13e40e9e
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/13e40e9e
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/13e40e9e

Branch: refs/heads/master
Commit: 13e40e9e6a158cdc3777f207387461483881e2c8
Parents: 2dae68d
Author: Chuck Rolke <cr...@redhat.com>
Authored: Mon Feb 27 17:38:51 2017 -0500
Committer: Chuck Rolke <cr...@redhat.com>
Committed: Mon Feb 27 17:38:51 2017 -0500

----------------------------------------------------------------------
 examples/cpp/direct_send.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/13e40e9e/examples/cpp/direct_send.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/direct_send.cpp b/examples/cpp/direct_send.cpp
index 7de762d..e6b4464 100644
--- a/examples/cpp/direct_send.cpp
+++ b/examples/cpp/direct_send.cpp
@@ -22,13 +22,14 @@
 #include "options.hpp"
 
 #include <proton/connection.hpp>
+#include <proton/connection_options.hpp>
 #include <proton/container.hpp>
 #include <proton/default_container.hpp>
-#include <proton/listener.hpp>
 #include <proton/message.hpp>
 #include <proton/message_id.hpp>
 #include <proton/messaging_handler.hpp>
 #include <proton/value.hpp>
+#include <proton/thread_safe.hpp>
 #include <proton/tracker.hpp>
 #include <proton/types.hpp>
 
@@ -40,7 +41,7 @@
 class simple_send : public proton::messaging_handler {
   private:
     std::string url;
-    proton::listener listener;
+    proton::sender sender;
     int sent;
     int confirmed;
     int total;
@@ -49,8 +50,8 @@ class simple_send : public proton::messaging_handler {
     simple_send(const std::string &s, int c) : url(s), sent(0), confirmed(0), total(c) {}
 
     void on_container_start(proton::container &c) OVERRIDE {
-        listener = c.listen(url);
-        std::cout << "direct_send listening on " << url << std::endl;
+        proton::connection_options co;
+        sender = c.open_sender(url, co);
     }
 
     void on_sendable(proton::sender &sender) OVERRIDE {
@@ -73,7 +74,6 @@ class simple_send : public proton::messaging_handler {
         if (confirmed == total) {
             std::cout << "all messages confirmed" << std::endl;
             t.connection().close();
-            listener.stop();
         }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org