diff options
author | Alan Conway <aconway@apache.org> | 2008-10-14 19:35:33 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-10-14 19:35:33 +0000 |
commit | 56fb1f26a04a9ba2b6af40c6933f8dcc79143772 (patch) | |
tree | 97b5824875315d628587fb66186a5300658bbf58 /cpp/examples/failover | |
parent | b17ea7f64cf3eb42c4614aa57508a7aaca132807 (diff) | |
download | qpid-python-56fb1f26a04a9ba2b6af40c6933f8dcc79143772.tar.gz |
Minor cleanup for client failover.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@704637 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/examples/failover')
-rw-r--r-- | cpp/examples/failover/direct_producer.cpp | 6 | ||||
-rw-r--r-- | cpp/examples/failover/listener.cpp | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/cpp/examples/failover/direct_producer.cpp b/cpp/examples/failover/direct_producer.cpp index ef2231a7f0..1bee56e164 100644 --- a/cpp/examples/failover/direct_producer.cpp +++ b/cpp/examples/failover/direct_producer.cpp @@ -40,14 +40,13 @@ main ( int argc, char ** argv) int port = argc>2 ? atoi(argv[2]) : 5672; int count = argc>3 ? atoi(argv[3]) : 30; int delayMs = argc>4 ? atoi(argv[4]) : 1000; + string program_name = "PRODUCER"; try { FailoverConnection connection; FailoverSession * session; Message message; - string program_name = "PRODUCER"; - connection.open ( host, port ); session = connection.newSession(); int sent = 0; @@ -89,9 +88,10 @@ main ( int argc, char ** argv) session->sync(); connection.close(); + std::cout << program_name << ": " << " completed without error." << std::endl; return 0; } catch(const std::exception& error) { - std::cout << error.what() << std::endl; + std::cout << program_name << ": " << error.what() << std::endl; } return 1; } diff --git a/cpp/examples/failover/listener.cpp b/cpp/examples/failover/listener.cpp index c4c7d096b3..1c47127389 100644 --- a/cpp/examples/failover/listener.cpp +++ b/cpp/examples/failover/listener.cpp @@ -229,9 +229,9 @@ main ( int argc, char ** argv ) { const char* host = argc>1 ? argv[1] : "127.0.0.1"; int port = argc>2 ? atoi(argv[2]) : 5672; + string program_name = "LISTENER"; try { - string program_name = "LISTENER"; FailoverConnection connection; FailoverSession * session; @@ -250,10 +250,11 @@ main ( int argc, char ** argv ) subscriptions.run ( ); connection.close(); + std::cout << program_name << ": " << " completed without error." << std::endl; return 0; } catch(const std::exception& error) { - std::cout << error.what() << std::endl; + std::cout << program_name << ": " << error.what() << std::endl; } return 1; } |