diff options
author | Alan Conway <aconway@apache.org> | 2008-10-17 16:45:24 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-10-17 16:45:24 +0000 |
commit | 7db0c0970eac260626263314c30f0e20d4ef6c21 (patch) | |
tree | 231024436b5b7185f63972d90318acce97816c22 /cpp/examples/direct/direct_producer.cpp | |
parent | a039e57108ed06586e73a255dc824ed27fc6de2a (diff) | |
download | qpid-python-7db0c0970eac260626263314c30f0e20d4ef6c21.tar.gz |
QPID-1367 Mick Goulish: improvements to client-side failover.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@705668 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/examples/direct/direct_producer.cpp')
-rw-r--r-- | cpp/examples/direct/direct_producer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cpp/examples/direct/direct_producer.cpp b/cpp/examples/direct/direct_producer.cpp index 40fc644bf3..baa8d9092b 100644 --- a/cpp/examples/direct/direct_producer.cpp +++ b/cpp/examples/direct/direct_producer.cpp @@ -64,6 +64,7 @@ using std::string; int main(int argc, char** argv) { const char* host = argc>1 ? argv[1] : "127.0.0.1"; int port = argc>2 ? atoi(argv[2]) : 5672; + int count = argc>3 ? atoi(argv[3]) : 10; Connection connection; Message message; try { @@ -81,14 +82,15 @@ int main(int argc, char** argv) { // Now send some messages ... - for (int i=0; i<10; i++) { + for (int i=0; i<count; i++) { stringstream message_data; message_data << "Message " << i; message.setData(message_data.str()); // Asynchronous transfer sends messages as quickly as // possible without waiting for confirmation. - async(session).messageTransfer(arg::content=message, arg::destination="amq.direct"); + // async(session).messageTransfer(arg::content=message, arg::destination="amq.direct"); + session.messageTransfer(arg::content=message, arg::destination="amq.direct"); } // And send a final message to indicate termination. |