MCPcopy Create free account
hub / github.com/apache/qpid-proton / send_thread

Function send_thread

cpp/examples/multithreaded_client_flow_control.cpp:234–243  ·  view source on GitHub ↗

Send n messages

Source from the content-addressed store, hash-verified

232
233// Send n messages
234void send_thread(sender& s, int n) {
235 auto id = std::this_thread::get_id();
236 for (int i = 0; i < n; ++i) {
237 std::ostringstream ss;
238 ss << std::this_thread::get_id() << "-" << i;
239 s.send(proton::message(ss.str()));
240 OUT(std::cout << id << " sent \"" << ss.str() << '"' << std::endl);
241 }
242 OUT(std::cout << id << " sent " << n << std::endl);
243}
244
245// Receive messages till atomic remaining count is 0.
246// remaining is shared among all receiving threads

Callers 1

mainFunction · 0.85

Calls 3

messageClass · 0.50
sendMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected