MCPcopy Create free account
hub / github.com/chenshuo/muduo / onStringMessage

Method onStringMessage

examples/asio/chat/loadtest.cc:73–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 }
72
73 void onStringMessage(const TcpConnectionPtr&,
74 const string& message,
75 Timestamp)
76 {
77 // printf("<<< %s\n", message.c_str());
78 receiveTime_ = loop_->pollReturnTime();
79 int received = g_messagesReceived.incrementAndGet();
80 if (received == g_connections)
81 {
82 Timestamp endTime = Timestamp::now();
83 LOG_INFO << "all received " << g_connections << " in "
84 << timeDifference(endTime, g_startTime);
85 g_loop->queueInLoop(g_statistic);
86 }
87 else if (received % 1000 == 0)
88 {
89 LOG_DEBUG << received;
90 }
91 }
92
93 void send()
94 {

Callers

nothing calls this directly

Calls 4

timeDifferenceFunction · 0.85
pollReturnTimeMethod · 0.80
incrementAndGetMethod · 0.80
queueInLoopMethod · 0.80

Tested by

no test coverage detected