From ce7678789fe3e8c5caebb59a26aa418fbb95e5d3 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Mon, 26 May 2008 18:10:05 +0000 Subject: Changes to Session API: - Session is synchronous, no futures. - AsyncSession is async, returns futures. - Conversion functions sync(s) async(s) return a sync/async view of session s. - Connection::newSession - takes name, no timeout - SessionBase::getId - returns SessionId not UUID. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@660258 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/latencytest.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cpp/src/tests/latencytest.cpp') diff --git a/cpp/src/tests/latencytest.cpp b/cpp/src/tests/latencytest.cpp index 0b343d0243..f4cbade36b 100644 --- a/cpp/src/tests/latencytest.cpp +++ b/cpp/src/tests/latencytest.cpp @@ -30,7 +30,7 @@ #include "TestOptions.h" #include "qpid/client/Connection.h" #include "qpid/client/Message.h" -#include "qpid/client/Session.h" +#include "qpid/client/AsyncSession.h" #include "qpid/client/SubscriptionManager.h" using namespace qpid; @@ -99,7 +99,7 @@ class Client : public Runnable { protected: Connection connection; - Session session; + AsyncSession session; Thread thread; string queue; @@ -157,7 +157,7 @@ public: Client::Client(const string& q) : queue(q) { opts.open(connection); - session = connection.newSession(ASYNC); + session = connection.newSession(); } void Client::start() @@ -262,7 +262,7 @@ void Sender::sendByCount() uint64_t sentAt(current_time()); msg.getDeliveryProperties().setTimestamp(sentAt); //msg.getHeaders().setTimestamp("sent-at", sentAt);//TODO add support for uint64_t to field tables - session.messageTransfer(arg::content=msg, arg::acceptMode=1); + async(session).messageTransfer(arg::content=msg, arg::acceptMode=1); } session.sync(); } @@ -283,7 +283,7 @@ void Sender::sendByRate() uint64_t sentAt(current_time()); msg.getDeliveryProperties().setTimestamp(sentAt); //msg.getHeaders().setTimestamp("sent-at", sentAt);//TODO add support for uint64_t to field tables - session.messageTransfer(arg::content=msg, arg::acceptMode=1); + async(session).messageTransfer(arg::content=msg, arg::acceptMode=1); } uint64_t timeTaken = (current_time() - start) / TIME_USEC; if (timeTaken < 1000) { -- cgit v1.2.1