summaryrefslogtreecommitdiff
path: root/cpp/src/tests/latencytest.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-05-26 18:10:05 +0000
committerAlan Conway <aconway@apache.org>2008-05-26 18:10:05 +0000
commitce7678789fe3e8c5caebb59a26aa418fbb95e5d3 (patch)
treeaffd8e2de460cba285e7c25e15f5c3d94444f905 /cpp/src/tests/latencytest.cpp
parent0b56077cbb8b6e9cdd982cbdeaa3ec6fe1bd5434 (diff)
downloadqpid-python-ce7678789fe3e8c5caebb59a26aa418fbb95e5d3.tar.gz
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
Diffstat (limited to 'cpp/src/tests/latencytest.cpp')
-rw-r--r--cpp/src/tests/latencytest.cpp10
1 files changed, 5 insertions, 5 deletions
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) {