Github user alanconway commented on a diff in the pull request:
https://github.com/apache/qpid-proton/pull/105#discussion_r118509113
--- Diff: proton-c/bindings/cpp/src/handler.cpp ---
@@ -49,17 +50,33 @@ void messaging_handler::on_transport_error(transport
&t) { on_error(t.error());
void messaging_handler::on_transport_open(transport &) {}
void messaging_handler::on_connection_close(connection &) {}
void messaging_handler::on_connection_error(connection &c) {
on_error(c.error()); }
-void messaging_handler::on_connection_open(connection &) {}
+void messaging_handler::on_connection_open(connection &c) {
+ if (c.uninitialized()) {
+ pn_connection_open(unwrap(c));
+ }
+}
void messaging_handler::on_session_close(session &) {}
void messaging_handler::on_session_error(session &s) {
on_error(s.error()); }
-void messaging_handler::on_session_open(session &) {}
+void messaging_handler::on_session_open(session &s) {
+ if (s.uninitialized()) {
+ pn_session_open(unwrap(s));
+ }
+}
void messaging_handler::on_receiver_close(receiver &) {}
void messaging_handler::on_receiver_error(receiver &l) {
on_error(l.error()); }
-void messaging_handler::on_receiver_open(receiver &) {}
+void messaging_handler::on_receiver_open(receiver &l) {
+ if (l.uninitialized()) {
+ l.open(l.container().receiver_options());
+ }
+}
void messaging_handler::on_receiver_detach(receiver &) {}
void messaging_handler::on_sender_close(sender &) {}
void messaging_handler::on_sender_error(sender &l) { on_error(l.error()); }
-void messaging_handler::on_sender_open(sender &) {}
+void messaging_handler::on_sender_open(sender &l) {
+ if (l.uninitialized()) {
+ l.open(l.container().sender_options());
--- End diff --
This looks like it will throw if the listener is not associated with a
container. I want to still support pure connection_driver based application
that might not have a "real" container impl - we could have a "null container"
with only a container ID. That can be fixed later - not an objection to this
commit.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]