summaryrefslogtreecommitdiff
path: root/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
commit077facba2cddd2c49d14e496dfa942c23a5e66c9 (patch)
treee9c078351733678236a01056a88ec5bf5e50372c /cpp/src/tests/qpid-send.cpp
parentc50499e4c309e43367c2ff4ab478d85f88c3124c (diff)
downloadqpid-python-077facba2cddd2c49d14e496dfa942c23a5e66c9.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/qpid@1049656 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/qpid-send.cpp')
-rw-r--r--cpp/src/tests/qpid-send.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/cpp/src/tests/qpid-send.cpp b/cpp/src/tests/qpid-send.cpp
index e5ae6a9e4a..c71cb83f9a 100644
--- a/cpp/src/tests/qpid-send.cpp
+++ b/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) {