Repository: qpid-proton Updated Branches: refs/heads/master 24dd60385 -> 278916a23
PROTON-1138: connection.release, heartbeat, link_prefix gone, max_channels -> max_sessions Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/278916a2 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/278916a2 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/278916a2 Branch: refs/heads/master Commit: 278916a237aa025d3ae776904ccc526b3c82e21c Parents: 24dd603 Author: Clifford Jansen <[email protected]> Authored: Tue May 3 20:32:11 2016 -0700 Committer: Clifford Jansen <[email protected]> Committed: Tue May 3 20:32:11 2016 -0700 ---------------------------------------------------------------------- examples/cpp/mt/epoll_controller.cpp | 2 +- .../bindings/cpp/include/proton/connection.hpp | 6 ----- .../cpp/include/proton/connection_options.hpp | 13 ++--------- proton-c/bindings/cpp/src/connection.cpp | 2 -- .../bindings/cpp/src/connection_options.cpp | 18 +++++---------- proton-c/bindings/cpp/src/connector.cpp | 2 +- proton-c/bindings/cpp/src/engine_test.cpp | 23 ++++---------------- 7 files changed, 13 insertions(+), 53 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/278916a2/examples/cpp/mt/epoll_controller.cpp ---------------------------------------------------------------------- diff --git a/examples/cpp/mt/epoll_controller.cpp b/examples/cpp/mt/epoll_controller.cpp index 01983c0..311ed08 100644 --- a/examples/cpp/mt/epoll_controller.cpp +++ b/examples/cpp/mt/epoll_controller.cpp @@ -260,7 +260,7 @@ class pollable_engine : public pollable { proton::handler* h, proton::connection_options opts, epoll_controller& c, int fd, int epoll_fd ) : pollable(fd, epoll_fd), - engine_(*h, opts.link_prefix(std::to_string(fd)+":")), + engine_(*h, opts), queue_(new work_queue(*this, c)) { engine_.work_queue(queue_.get()); http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/278916a2/proton-c/bindings/cpp/include/proton/connection.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/connection.hpp b/proton-c/bindings/cpp/include/proton/connection.hpp index 11a48e9..1de2745 100644 --- a/proton-c/bindings/cpp/include/proton/connection.hpp +++ b/proton-c/bindings/cpp/include/proton/connection.hpp @@ -86,12 +86,6 @@ PN_CPP_CLASS_EXTERN connection : public internal::object<pn_connection_t>, publi /// The operation is not complete till handler::on_connection_close(). PN_CPP_EXTERN void close(const error_condition&); - /// @cond INTERNAL - /// XXX undiscussed - /// Release link and session resources of this connection. - PN_CPP_EXTERN void release(); - /// @endcond - /// Open a new session. PN_CPP_EXTERN session open_session(const session_options &opts = session_options()); http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/278916a2/proton-c/bindings/cpp/include/proton/connection_options.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/connection_options.hpp b/proton-c/bindings/cpp/include/proton/connection_options.hpp index d2f58a7..d736600 100644 --- a/proton-c/bindings/cpp/include/proton/connection_options.hpp +++ b/proton-c/bindings/cpp/include/proton/connection_options.hpp @@ -86,18 +86,13 @@ class connection_options { /// Set the maximum frame size. PN_CPP_EXTERN connection_options& max_frame_size(uint32_t max); - /// Set the maximum channels. - PN_CPP_EXTERN connection_options& max_channels(uint16_t max); + /// Set the maximum number of open sessions. + PN_CPP_EXTERN connection_options& max_sessions(uint16_t max); // XXX document relationship to heartbeat interval /// Set the idle timeout. PN_CPP_EXTERN connection_options& idle_timeout(duration); - /// @cond INTERNAL - /// XXX remove - PN_CPP_EXTERN connection_options& heartbeat(duration); - /// @endcond - /// Set the container ID. PN_CPP_EXTERN connection_options& container_id(const std::string &id); @@ -106,10 +101,6 @@ class connection_options { /// @cond INTERNAL - /// XXX more discussion - not clear we want to support this - /// capability - PN_CPP_EXTERN connection_options& link_prefix(const std::string &id); - /// XXX settle questions about reconnect_timer - consider simply /// reconnect_options and making reconnect_timer internal PN_CPP_EXTERN connection_options& reconnect(const reconnect_timer &); http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/278916a2/proton-c/bindings/cpp/src/connection.cpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/src/connection.cpp b/proton-c/bindings/cpp/src/connection.cpp index 33451c3..72f8fb8 100644 --- a/proton-c/bindings/cpp/src/connection.cpp +++ b/proton-c/bindings/cpp/src/connection.cpp @@ -59,8 +59,6 @@ void connection::open(const connection_options &opts) { void connection::close() { pn_connection_close(pn_object()); } -void connection::release() { pn_connection_release(pn_object()); } - std::string connection::virtual_host() const { return str(pn_connection_get_hostname(pn_object())); } http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/278916a2/proton-c/bindings/cpp/src/connection_options.cpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/src/connection_options.cpp b/proton-c/bindings/cpp/src/connection_options.cpp index fe4582a..fed645c 100644 --- a/proton-c/bindings/cpp/src/connection_options.cpp +++ b/proton-c/bindings/cpp/src/connection_options.cpp @@ -49,12 +49,10 @@ class connection_options::impl { public: option<proton_handler*> handler; option<uint32_t> max_frame_size; - option<uint16_t> max_channels; + option<uint16_t> max_sessions; option<duration> idle_timeout; - option<duration> heartbeat; option<std::string> container_id; option<std::string> virtual_host; - option<std::string> link_prefix; option<reconnect_timer> reconnect; option<class ssl_client_options> ssl_client_options; option<class ssl_server_options> ssl_server_options; @@ -109,8 +107,8 @@ class connection_options::impl { if (max_frame_size.set) pn_transport_set_max_frame(pnt, max_frame_size.value); - if (max_channels.set) - pn_transport_set_channel_max(pnt, max_channels.value); + if (max_sessions.set) + pn_transport_set_channel_max(pnt, max_sessions.value); if (idle_timeout.set) pn_transport_set_idle_timeout(pnt, idle_timeout.value.milliseconds()); } @@ -122,20 +120,16 @@ class connection_options::impl { pn_connection_set_container(pnc, container_id.value.c_str()); if (virtual_host.set) pn_connection_set_hostname(pnc, virtual_host.value.c_str()); - if (link_prefix.set) - connection_context::get(pnc).link_gen.prefix(link_prefix.value); } } void update(const impl& x) { handler.update(x.handler); max_frame_size.update(x.max_frame_size); - max_channels.update(x.max_channels); + max_sessions.update(x.max_sessions); idle_timeout.update(x.idle_timeout); - heartbeat.update(x.heartbeat); container_id.update(x.container_id); virtual_host.update(x.virtual_host); - link_prefix.update(x.link_prefix); reconnect.update(x.reconnect); ssl_client_options.update(x.ssl_client_options); ssl_server_options.update(x.ssl_server_options); @@ -174,12 +168,10 @@ connection_options connection_options::update(const connection_options& x) const connection_options& connection_options::handler(class handler *h) { impl_->handler = h->messaging_adapter_.get(); return *this; } connection_options& connection_options::max_frame_size(uint32_t n) { impl_->max_frame_size = n; return *this; } -connection_options& connection_options::max_channels(uint16_t n) { impl_->max_frame_size = n; return *this; } +connection_options& connection_options::max_sessions(uint16_t n) { impl_->max_sessions = n; return *this; } connection_options& connection_options::idle_timeout(duration t) { impl_->idle_timeout = t; return *this; } -connection_options& connection_options::heartbeat(duration t) { impl_->heartbeat = t; return *this; } connection_options& connection_options::container_id(const std::string &id) { impl_->container_id = id; return *this; } connection_options& connection_options::virtual_host(const std::string &id) { impl_->virtual_host = id; return *this; } -connection_options& connection_options::link_prefix(const std::string &id) { impl_->link_prefix = id; return *this; } connection_options& connection_options::reconnect(const reconnect_timer &rc) { impl_->reconnect = rc; return *this; } connection_options& connection_options::ssl_client_options(const class ssl_client_options &c) { impl_->ssl_client_options = c; return *this; } connection_options& connection_options::ssl_server_options(const class ssl_server_options &c) { impl_->ssl_server_options = c; return *this; } http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/278916a2/proton-c/bindings/cpp/src/connector.cpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/src/connector.cpp b/proton-c/bindings/cpp/src/connector.cpp index ccd5751..dbf74be 100644 --- a/proton-c/bindings/cpp/src/connector.cpp +++ b/proton-c/bindings/cpp/src/connector.cpp @@ -108,7 +108,7 @@ void connector::on_transport_closed(proton_event &) { } } } - connection_.release(); + pn_connection_release(unwrap(connection_)); connection_ = 0; } http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/278916a2/proton-c/bindings/cpp/src/engine_test.cpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/src/engine_test.cpp b/proton-c/bindings/cpp/src/engine_test.cpp index 007be11..e070b50 100644 --- a/proton-c/bindings/cpp/src/engine_test.cpp +++ b/proton-c/bindings/cpp/src/engine_test.cpp @@ -123,31 +123,16 @@ struct record_handler : public handler { } }; -void test_engine_prefix() { +void test_engine_container_id() { // Set container ID and prefix explicitly record_handler ha, hb; engine_pair e(ha, hb, - connection_options().container_id("a").link_prefix("x/"), - connection_options().container_id("b").link_prefix("y/")); + connection_options().container_id("a"), + connection_options().container_id("b")); e.a.connection().open(); ASSERT_EQUAL("a", e.a.connection().container_id()); e.b.connection().open(); ASSERT_EQUAL("b", e.b.connection().container_id()); - - e.a.connection().open_sender("x"); - while (ha.senders.empty() || hb.receivers.empty()) e.process(); - ASSERT_EQUAL("x/1", quick_pop(ha.senders).name()); - ASSERT_EQUAL("x/1", quick_pop(hb.receivers).name()); - - e.a.connection().open_receiver(""); - while (ha.receivers.empty() || hb.senders.empty()) e.process(); - ASSERT_EQUAL("x/2", quick_pop(ha.receivers).name()); - ASSERT_EQUAL("x/2", quick_pop(hb.senders).name()); - - e.b.connection().open_receiver(""); - while (ha.senders.empty() || hb.receivers.empty()) e.process(); - ASSERT_EQUAL("y/1", quick_pop(ha.senders).name()); - ASSERT_EQUAL("y/1", quick_pop(hb.receivers).name()); } void test_endpoint_close() { @@ -201,7 +186,7 @@ void test_transport_close() { int main(int, char**) { int failed = 0; - RUN_TEST(failed, test_engine_prefix()); + RUN_TEST(failed, test_engine_container_id()); RUN_TEST(failed, test_endpoint_close()); RUN_TEST(failed, test_transport_close()); return failed; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
