qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject [1/2] qpid-proton git commit: WIP: use duration
Date Fri, 22 Jan 2016 14:28:57 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master 8e890a40d -> 103b31255


WIP: use duration


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

Branch: refs/heads/master
Commit: 08e5d957669d9a9a9954af0d64516056185626d8
Parents: 8e890a4
Author: Alan Conway <aconway@redhat.com>
Authored: Fri Jan 22 08:38:07 2016 -0500
Committer: Alan Conway <aconway@redhat.com>
Committed: Fri Jan 22 09:27:04 2016 -0500

----------------------------------------------------------------------
 examples/cpp/connection_options.cpp                       |  2 +-
 .../bindings/cpp/include/proton/connection_options.hpp    |  4 ++--
 proton-c/bindings/cpp/include/proton/duration.hpp         |  4 ++--
 proton-c/bindings/cpp/src/connection_options.cpp          | 10 +++++-----
 4 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/08e5d957/examples/cpp/connection_options.cpp
----------------------------------------------------------------------
diff --git a/examples/cpp/connection_options.cpp b/examples/cpp/connection_options.cpp
index 10bd320..1052b55 100644
--- a/examples/cpp/connection_options.cpp
+++ b/examples/cpp/connection_options.cpp
@@ -64,7 +64,7 @@ int main(int argc, char **argv) {
         main_handler handler(url);
         proton::container container(handler);
         // Global connection options for future connections on container.
-        container.client_connection_options(connection_options().max_frame_size(12345).idle_timeout(15000));
+        container.client_connection_options(connection_options().max_frame_size(12345).idle_timeout(proton::duration(15000)));
         container.run();
         return 0;
     } catch (const std::exception& e) {

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/08e5d957/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 bebeef7..21468f9 100644
--- a/proton-c/bindings/cpp/include/proton/connection_options.hpp
+++ b/proton-c/bindings/cpp/include/proton/connection_options.hpp
@@ -66,8 +66,8 @@ class connection_options {
     PN_CPP_EXTERN connection_options& handler(class handler *);
     PN_CPP_EXTERN connection_options& max_frame_size(uint32_t max);
     PN_CPP_EXTERN connection_options& max_channels(uint16_t max);
-    PN_CPP_EXTERN connection_options& idle_timeout(uint32_t t);
-    PN_CPP_EXTERN connection_options& heartbeat(uint32_t t);
+    PN_CPP_EXTERN connection_options& idle_timeout(duration);
+    PN_CPP_EXTERN connection_options& heartbeat(duration);
     PN_CPP_EXTERN connection_options& container_id(const std::string &id);
     PN_CPP_EXTERN connection_options& reconnect(const reconnect_timer &);
     PN_CPP_EXTERN connection_options& client_domain(const class client_domain &);

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/08e5d957/proton-c/bindings/cpp/include/proton/duration.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/duration.hpp b/proton-c/bindings/cpp/include/proton/duration.hpp
index cea785f..3d9b823 100644
--- a/proton-c/bindings/cpp/include/proton/duration.hpp
+++ b/proton-c/bindings/cpp/include/proton/duration.hpp
@@ -31,8 +31,8 @@ namespace proton {
 class duration
 {
   public:
-    amqp_ulong milliseconds;
-    explicit duration(amqp_ulong ms = 0) : milliseconds(ms) {}
+    uint64_t milliseconds;
+    explicit duration(uint64_t ms = 0) : milliseconds(ms) {}
 
     PN_CPP_EXTERN static const duration FOREVER; ///< Wait for ever
     PN_CPP_EXTERN static const duration IMMEDIATE; ///< Don't wait at all

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/08e5d957/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 013daaa..45afda2 100644
--- a/proton-c/bindings/cpp/src/connection_options.cpp
+++ b/proton-c/bindings/cpp/src/connection_options.cpp
@@ -48,8 +48,8 @@ class connection_options::impl {
     option<proton_handler*> handler;
     option<uint32_t> max_frame_size;
     option<uint16_t> max_channels;
-    option<uint32_t> idle_timeout;
-    option<uint32_t> heartbeat;
+    option<duration> idle_timeout;
+    option<duration> heartbeat;
     option<std::string> container_id;
     option<reconnect_timer> reconnect;
     option<class client_domain> client_domain;
@@ -113,7 +113,7 @@ class connection_options::impl {
             if (max_channels.set)
                 pn_transport_set_channel_max(pnt, max_channels.value);
             if (idle_timeout.set)
-                pn_transport_set_idle_timeout(pnt, idle_timeout.value);
+                pn_transport_set_idle_timeout(pnt, idle_timeout.value.milliseconds);
         }
         // Only apply connection options if uninit.
         if (uninit) {
@@ -161,8 +161,8 @@ void connection_options::override(const connection_options& x) { impl_->override
 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::idle_timeout(uint32_t t) { impl_->idle_timeout
= t; return *this; }
-connection_options& connection_options::heartbeat(uint32_t t) { impl_->heartbeat =
t; 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::reconnect(const reconnect_timer &rc) { impl_->reconnect
= rc; return *this; }
 connection_options& connection_options::client_domain(const class client_domain &c)
{ impl_->client_domain = c; return *this; }


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


Mime
View raw message