summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/qpid-send.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-12-15 18:10:12 +0000
committerAlan Conway <aconway@apache.org>2010-12-15 18:10:12 +0000
commit98fb574050919fb49291538867351f0644be3ae1 (patch)
tree80947313e10e6969780830003a21f514b3025d07 /qpid/cpp/src/tests/qpid-send.cpp
parent9f13478e6ad313df9f548a65553c1cb18e00d43b (diff)
downloadqpid-python-98fb574050919fb49291538867351f0644be3ae1.tar.gz
Fix flow control for qpid-cpp-benchmark with multiple senders.
Ensure senders & receivers agree on number of messages sent/received. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1049656 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/qpid-send.cpp')
-rw-r--r--qpid/cpp/src/tests/qpid-send.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/qpid/cpp/src/tests/qpid-send.cpp b/qpid/cpp/src/tests/qpid-send.cpp
index e5ae6a9e4a..c71cb83f9a 100644
--- a/qpid/cpp/src/tests/qpid-send.cpp
+++ b/qpid/cpp/src/tests/qpid-send.cpp
@@ -291,7 +291,7 @@ int main(int argc, char ** argv)
if (opts.sendRate) interval = qpid::sys::TIME_SEC/opts.sendRate;
Receiver flowControlReceiver;
- Address flowControlAddress(Uuid(true).str()+";{create:always}");
+ Address flowControlAddress("flow-"+Uuid(true).str()+";{create:always,delete:always}");
uint flowSent = 0;
if (opts.flowControl) {
flowControlReceiver = session.createReceiver(flowControlAddress);
@@ -322,7 +322,7 @@ int main(int argc, char ** argv)
if (opts.messages && sent >= opts.messages) break;
if (opts.flowControl && flowSent == 2) {
- flowControlReceiver.get(Duration::SECOND*1);
+ flowControlReceiver.get(Duration::SECOND);
--flowSent;
}
@@ -333,11 +333,13 @@ int main(int argc, char ** argv)
}
msg = Message(); // Clear out contents and properties for next iteration
}
+ for ( ; flowSent>0; --flowSent)
+ flowControlReceiver.get(Duration::SECOND);
if (opts.reportTotal) reporter.report();
for (uint i = opts.sendEos; i > 0; --i) {
if (opts.sequence)
msg.getProperties()[SN] = ++sent;
- msg.setContent(EOS);//TODO: add in ability to send digest or similar
+ msg.setContent(EOS); //TODO: add in ability to send digest or similar
sender.send(msg);
}
if (opts.tx) {