qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject [1/5] qpid-proton git commit: PROTON-1108: [C++ binding] Rename DISCONNECT event to TRANSPORT_CLOSE, add TRANSPORT_ERROR event
Date Mon, 25 Jan 2016 22:10:44 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master 290bc2556 -> 195e979f9


PROTON-1108: [C++ binding] Rename DISCONNECT event to TRANSPORT_CLOSE, add TRANSPORT_ERROR
event


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

Branch: refs/heads/master
Commit: 4a6ed17c9f9ed455097c7ecbca059f6d37f6d897
Parents: 0845878
Author: Andrew Stitcher <astitcher@apache.org>
Authored: Mon Jan 25 13:25:50 2016 -0500
Committer: Andrew Stitcher <astitcher@apache.org>
Committed: Mon Jan 25 13:55:54 2016 -0500

----------------------------------------------------------------------
 examples/cpp/broker.hpp                          |  2 +-
 examples/cpp/direct_send.cpp                     |  2 +-
 examples/cpp/engine/direct_send.cpp              |  2 +-
 examples/cpp/engine/simple_send.cpp              |  2 +-
 examples/cpp/simple_send.cpp                     |  2 +-
 proton-c/bindings/cpp/include/proton/handler.hpp |  4 +++-
 proton-c/bindings/cpp/src/handler.cpp            | 19 ++++++++++---------
 proton-c/bindings/cpp/src/messaging_adapter.cpp  | 11 +++++++++--
 proton-c/bindings/cpp/src/messaging_event.cpp    |  3 ++-
 proton-c/bindings/cpp/src/messaging_event.hpp    |  3 ++-
 10 files changed, 31 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4a6ed17c/examples/cpp/broker.hpp
----------------------------------------------------------------------
diff --git a/examples/cpp/broker.hpp b/examples/cpp/broker.hpp
index 4313bab..1c13ae4 100644
--- a/examples/cpp/broker.hpp
+++ b/examples/cpp/broker.hpp
@@ -174,7 +174,7 @@ class broker_handler : public proton::handler {
         remove_stale_consumers(e.connection());
     }
 
-    void on_disconnect(proton::event &e) {
+    void on_transport_close(proton::event &e) {
         remove_stale_consumers(e.connection());
     }
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4a6ed17c/examples/cpp/direct_send.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/direct_send.cpp b/examples/cpp/direct_send.cpp
index 35b41d5..d171175 100644
--- a/examples/cpp/direct_send.cpp
+++ b/examples/cpp/direct_send.cpp
@@ -69,7 +69,7 @@ class simple_send : public proton::handler {
         }
     }
 
-    void on_disconnect(proton::event &e) {
+    void on_transport_close(proton::event &e) {
         sent = confirmed;
     }
 };

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4a6ed17c/examples/cpp/engine/direct_send.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/engine/direct_send.cpp b/examples/cpp/engine/direct_send.cpp
index 3659aea..e3c632d 100644
--- a/examples/cpp/engine/direct_send.cpp
+++ b/examples/cpp/engine/direct_send.cpp
@@ -65,7 +65,7 @@ class simple_send : public proton::handler {
         }
     }
 
-    void on_disconnect(proton::event &e) {
+    void on_transport_close(proton::event &e) {
         sent = confirmed;
     }
 };

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4a6ed17c/examples/cpp/engine/simple_send.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/engine/simple_send.cpp b/examples/cpp/engine/simple_send.cpp
index 3b9a6f0..5bb0142 100644
--- a/examples/cpp/engine/simple_send.cpp
+++ b/examples/cpp/engine/simple_send.cpp
@@ -68,7 +68,7 @@ class simple_send : public proton::handler {
         }
     }
 
-    void on_disconnect(proton::event &e) {
+    void on_transport_close(proton::event &e) {
         sent = confirmed;
     }
 };

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4a6ed17c/examples/cpp/simple_send.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/simple_send.cpp b/examples/cpp/simple_send.cpp
index 5a2d401..cfec153 100644
--- a/examples/cpp/simple_send.cpp
+++ b/examples/cpp/simple_send.cpp
@@ -66,7 +66,7 @@ class simple_send : public proton::handler {
         }
     }
 
-    void on_disconnect(proton::event &e) {
+    void on_transport_close(proton::event &e) {
         sent = confirmed;
     }
 };

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4a6ed17c/proton-c/bindings/cpp/include/proton/handler.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/handler.hpp b/proton-c/bindings/cpp/include/proton/handler.hpp
index fde9716..207df7f 100644
--- a/proton-c/bindings/cpp/include/proton/handler.hpp
+++ b/proton-c/bindings/cpp/include/proton/handler.hpp
@@ -56,7 +56,9 @@ class handler
     PN_CPP_EXTERN virtual void on_start(event &e);
     PN_CPP_EXTERN virtual void on_message(event &e);
     PN_CPP_EXTERN virtual void on_sendable(event &e);
-    PN_CPP_EXTERN virtual void on_disconnect(event &e);
+
+    PN_CPP_EXTERN virtual void on_transport_close(event &e);
+    PN_CPP_EXTERN virtual void on_transport_error(event &e);
 
     PN_CPP_EXTERN virtual void on_connection_open(event &e);
     PN_CPP_EXTERN virtual void on_connection_close(event &e);

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4a6ed17c/proton-c/bindings/cpp/src/handler.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/handler.cpp b/proton-c/bindings/cpp/src/handler.cpp
index 4597156..b08628d 100644
--- a/proton-c/bindings/cpp/src/handler.cpp
+++ b/proton-c/bindings/cpp/src/handler.cpp
@@ -35,24 +35,25 @@ handler::handler(int prefetch0, bool auto_accept0, bool auto_settle0,
bool peer_
 
 handler::~handler(){}
 
-void handler::on_delivery_accept(event &e) { on_unhandled(e); }
+void handler::on_start(event &e) { on_unhandled(e); }
+void handler::on_message(event &e) { on_unhandled(e); }
+void handler::on_sendable(event &e) { on_unhandled(e); }
+void handler::on_timer(event &e) { on_unhandled(e); }
+void handler::on_transport_close(event &e) { on_unhandled(e); }
+void handler::on_transport_error(event &e) { on_unhandled(e); }
 void handler::on_connection_close(event &e) { on_unhandled(e); }
 void handler::on_connection_error(event &e) { on_unhandled(e); }
 void handler::on_connection_open(event &e) { on_unhandled(e); }
-void handler::on_disconnect(event &e) { on_unhandled(e); }
+void handler::on_session_close(event &e) { on_unhandled(e); }
+void handler::on_session_error(event &e) { on_unhandled(e); }
+void handler::on_session_open(event &e) { on_unhandled(e); }
 void handler::on_link_close(event &e) { on_unhandled(e); }
 void handler::on_link_error(event &e) { on_unhandled(e); }
 void handler::on_link_open(event &e) { on_unhandled(e); }
-void handler::on_message(event &e) { on_unhandled(e); }
+void handler::on_delivery_accept(event &e) { on_unhandled(e); }
 void handler::on_delivery_reject(event &e) { on_unhandled(e); }
 void handler::on_delivery_release(event &e) { on_unhandled(e); }
-void handler::on_sendable(event &e) { on_unhandled(e); }
-void handler::on_session_close(event &e) { on_unhandled(e); }
-void handler::on_session_error(event &e) { on_unhandled(e); }
-void handler::on_session_open(event &e) { on_unhandled(e); }
 void handler::on_delivery_settle(event &e) { on_unhandled(e); }
-void handler::on_start(event &e) { on_unhandled(e); }
-void handler::on_timer(event &e) { on_unhandled(e); }
 void handler::on_transaction_abort(event &e) { on_unhandled(e); }
 void handler::on_transaction_commit(event &e) { on_unhandled(e); }
 void handler::on_transaction_declare(event &e) { on_unhandled(e); }

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4a6ed17c/proton-c/bindings/cpp/src/messaging_adapter.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/messaging_adapter.cpp b/proton-c/bindings/cpp/src/messaging_adapter.cpp
index cc6f097..56939e5 100644
--- a/proton-c/bindings/cpp/src/messaging_adapter.cpp
+++ b/proton-c/bindings/cpp/src/messaging_adapter.cpp
@@ -34,6 +34,7 @@
 #include "proton/connection.h"
 #include "proton/session.h"
 #include "proton/message.h"
+#include "proton/transport.h"
 
 namespace proton {
 
@@ -246,8 +247,14 @@ void messaging_adapter::on_link_remote_open(proton_event &pe) {
 void messaging_adapter::on_transport_tail_closed(proton_event &pe) {
     pn_connection_t *conn = pn_event_connection(pe.pn_event());
     if (conn && is_local_open(pn_connection_state(conn))) {
-        messaging_event mevent(messaging_event::DISCONNECT, pe);
-        delegate_.on_disconnect(mevent);
+        pn_transport_t *t = pn_event_transport(pe.pn_event());
+        if (pn_condition_is_set(pn_transport_condition(t))) {
+            messaging_event mevent(messaging_event::TRANSPORT_ERROR, pe);
+            delegate_.on_transport_error(mevent);
+        } else {
+            messaging_event mevent(messaging_event::TRANSPORT_CLOSE, pe);
+            delegate_.on_transport_close(mevent);
+        }
     }
 }
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4a6ed17c/proton-c/bindings/cpp/src/messaging_event.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/messaging_event.cpp b/proton-c/bindings/cpp/src/messaging_event.cpp
index 1434ac7..9ee8d9a 100644
--- a/proton-c/bindings/cpp/src/messaging_event.cpp
+++ b/proton-c/bindings/cpp/src/messaging_event.cpp
@@ -96,7 +96,8 @@ std::string messaging_event::name() const {
       case START:            return "START";
       case MESSAGE:          return "MESSAGE";
       case SENDABLE:         return "SENDABLE";
-      case DISCONNECT:       return "DISCONNECT";
+      case TRANSPORT_CLOSE:  return "TRANSPORT_CLOSE";
+      case TRANSPORT_ERROR:  return "TRANSPORT_ERROR";
       case DELIVERY_ACCEPT:  return "DELIVERY_ACCEPT";
       case DELIVERY_REJECT:  return "DELIVERY_REJECT";
       case DELIVERY_RELEASE: return "DELIVERY_RELEASE";

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4a6ed17c/proton-c/bindings/cpp/src/messaging_event.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/messaging_event.hpp b/proton-c/bindings/cpp/src/messaging_event.hpp
index 381d375..b2f3c36 100644
--- a/proton-c/bindings/cpp/src/messaging_event.hpp
+++ b/proton-c/bindings/cpp/src/messaging_event.hpp
@@ -46,7 +46,8 @@ class messaging_event : public event
         START,
         MESSAGE,
         SENDABLE,
-        DISCONNECT,
+        TRANSPORT_CLOSE,
+        TRANSPORT_ERROR,
         CONNECTION_OPEN,
         CONNECTION_CLOSE,
         CONNECTION_ERROR,


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


Mime
View raw message