PROTON-1557: c++ correct output typo in multi-threaded examples
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/759686f1 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/759686f1 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/759686f1 Branch: refs/heads/go1 Commit: 759686f1e4ba0cff5aad902ae031a208341ebc4d Parents: d7e3aa5 Author: Alan Conway <[email protected]> Authored: Wed Aug 30 13:28:02 2017 -0400 Committer: Alan Conway <[email protected]> Committed: Wed Aug 30 13:55:03 2017 -0400 ---------------------------------------------------------------------- examples/cpp/multithreaded_client.cpp | 4 ++-- examples/cpp/multithreaded_client_flow_control.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/759686f1/examples/cpp/multithreaded_client.cpp ---------------------------------------------------------------------- diff --git a/examples/cpp/multithreaded_client.cpp b/examples/cpp/multithreaded_client.cpp index 4119bbf..6fb7868 100644 --- a/examples/cpp/multithreaded_client.cpp +++ b/examples/cpp/multithreaded_client.cpp @@ -157,7 +157,7 @@ int main(int argc, const char** argv) { for (int i = 0; i < n_messages; ++i) { proton::message msg(std::to_string(i + 1)); cl.send(msg); - OUT(std::cout << "sent: " << msg.body() << std::endl); + OUT(std::cout << "sent \"" << msg.body() << '"' << std::endl); } }); @@ -165,7 +165,7 @@ int main(int argc, const char** argv) { std::thread receiver([&]() { for (int i = 0; i < n_messages; ++i) { auto msg = cl.receive(); - OUT(std::cout << " received: " << msg.body() << std::endl); + OUT(std::cout << "received \"" << msg.body() << '"' << std::endl); ++received; } }); http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/759686f1/examples/cpp/multithreaded_client_flow_control.cpp ---------------------------------------------------------------------- diff --git a/examples/cpp/multithreaded_client_flow_control.cpp b/examples/cpp/multithreaded_client_flow_control.cpp index 8764793..c2b403b 100644 --- a/examples/cpp/multithreaded_client_flow_control.cpp +++ b/examples/cpp/multithreaded_client_flow_control.cpp @@ -218,9 +218,9 @@ void send_thread(sender& s, int n) { auto id = std::this_thread::get_id(); for (int i = 0; i < n; ++i) { std::ostringstream ss; - ss << std::this_thread::get_id() << ":" << i; + ss << std::this_thread::get_id() << "-" << i; s.send(proton::message(ss.str())); - OUT(std::cout << id << " received: " << ss.str() << std::endl); + OUT(std::cout << id << " sent \"" << ss.str() << '"' << std::endl); } OUT(std::cout << id << " sent " << n << std::endl); } @@ -236,7 +236,7 @@ void receive_thread(receiver& r, std::atomic_int& remaining) { while (remaining-- > 0) { auto m = r.receive(); ++n; - OUT(std::cout << id << " received: " << m.body() << std::endl); + OUT(std::cout << id << " received \"" << m.body() << '"' << std::endl); } OUT(std::cout << id << " received " << n << " messages" << std::endl); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
